0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-23 22:27:34 -05:00
verdaccio/website/translated_docs/zh-Hans/kubernetes.md

80 lines
2 KiB
Markdown
Raw Normal View History

New Crowdin translations (#456) * New translations ansible.md (Chinese Simplified) * New translations packages.md (Chinese Simplified) * New translations windows.md (Chinese Simplified) * New translations web.md (Chinese Simplified) * New translations use-cases.md (Chinese Simplified) * New translations uplinks.md (Chinese Simplified) * New translations test.md (Chinese Simplified) * New translations ssl.md (Chinese Simplified) * New translations server.md (Chinese Simplified) * New translations reverse-proxy.md (Chinese Simplified) * New translations repositories.md (Chinese Simplified) * New translations protect-your-dependencies.md (Chinese Simplified) * New translations plugins.md (Chinese Simplified) * New translations notifications.md (Chinese Simplified) * New translations auth.md (Chinese Simplified) * New translations logger.md (Chinese Simplified) * New translations kubernetes.md (Chinese Simplified) * New translations install.md (Chinese Simplified) * New translations index.md (Chinese Simplified) * New translations iis-server.md (Chinese Simplified) * New translations home.md (Chinese Simplified) * New translations docker.md (Chinese Simplified) * New translations dev-plugins.md (Chinese Simplified) * New translations contributing.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations cli.md (Chinese Simplified) * New translations build.md (Chinese Simplified) * New translations en.json (Chinese Simplified) * New translations en.json (Chinese Simplified) * New translations en.json (Chinese Simplified) * New translations en.json (Chinese Simplified) * New translations install.md (Chinese Simplified) * New translations install.md (Chinese Simplified) * New translations home.md (Chinese Simplified) * New translations cli.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations auth.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations auth.md (Chinese Simplified) * New translations auth.md (Chinese Simplified) * New translations config.md (Chinese Simplified) * New translations en.json (Spanish) * New translations en.json (Spanish) * New translations en.json (Spanish) * New translations en.json (Spanish) * New translations en.json (Spanish) * New translations config.md (Chinese Simplified) * New translations config.md (Spanish) * New translations config.md (Urdu (Pakistan)) * New translations config.md (Chinese Traditional, Hong Kong) * New translations config.md (Portuguese, Brazilian) * New translations config.md (Chinese Traditional)
2018-01-08 14:45:03 -05:00
---
id: kubernetes
title: Kubernetes
---
You can find instructions to deploy Verdaccio on a Kubernetes cluster on the [verdaccio/docker-example](https://github.com/verdaccio/docker-examples/tree/master/kubernetes-example) repository. However, the recommended method to install Verdaccio on a Kubernetes cluster is to use [Helm](https://helm.sh). Helm is a [Kubernetes](https://kubernetes.io) package manager which bring multiple advantages.
## Helm
### Setup Helm
If you haven't used Helm before, you need to setup the Helm controller called Tiller:
```bash
helm init
```
### Install
Deploy the Helm [stable/verdaccio](https://github.com/kubernetes/charts/tree/master/stable/verdaccio) chart. In this example we use `npm` as release name:
```bash
helm install --name npm stable/verdaccio
```
### Deploy a specific version
```bash
helm install --name npm --set image.tag=2.6.5 stable/verdaccio
```
### Upgrading Verdaccio
```bash
helm upgrade npm stable/verdaccio
```
### Uninstalling
```bash
helm del --purge npm
```
**Note:** this command delete all the resources, including packages that you may have previously published to the registry.
### Custom Verdaccio configuration
You can customize the Verdaccio configuration using a Kubernetes *configMap*.
#### Prepare
Copy the [existing configuration](https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml) and adapt it for your use case:
```bash
wget https://github.com/verdaccio/verdaccio/blob/master/conf/full.yaml -O config.yaml
```
**Note:** Make sure you are using the right path for the storage that is used for persistency:
```yaml
storage: /verdaccio/storage/data
auth:
htpasswd:
file: /verdaccio/storage/htpasswd
```
#### Deploy the configMap
Deploy the `configMap` to the cluster
```bash
kubectl create configmap verdaccio-config --from-file ./config.yaml
```
#### Deploy Verdaccio
Now you can deploy the Verdaccio Helm chart and specify which configuration to use:
```bash
helm install --name npm --set customConfigMap=verdaccio-config stable/verdaccio
```