Kubernetes
You can find instructions to deploy Verdaccio on a Kubernetes cluster on the verdaccio/docker-example repository. However, the recommended method to install Verdaccio on a Kubernetes cluster is to use Helm. Helm is a Kubernetes package manager which bring multiple advantages.
Helm
Setup Helm
Ako ranije niste koristili Helm, potrebno je da podesite Helm kontroler zvani Tiller:
helm init
Instaliranje
⚠️ If you are using this helm chart, please be aware of the migration of the repository.
Deploy the Helm verdaccio/verdaccio chart.
Postavljanje specifične verzije (deploy)
helm install --name npm stable/verdaccio
Napomena: ova komanda briše sve resurse, uključujući i pakete koji su možda ranije objavljeni u registriju.
helm install --name npm --set image.tag=2.6.5 stable/verdaccio
Deploy a specific version
helm upgrade npm stable/verdaccio
Upgrading Verdaccio
helm del --purge npm
Uninstalling
wget https://raw.githubusercontent.com/verdaccio/verdaccio/master/conf/docker.yaml -O config.yaml
Možete podesiti Verdaccio konfiguraciju po svojim željama tako što ćete koristiti Kubernetes configMap.
Custom Verdaccio configuration
Copy the existing configuration and adapt it for your use case:
Prepare
Napomena: Proverite da li koristite ispravan path za storage koji se koristi za persistency:
wget https://raw.githubusercontent.com/verdaccio/verdaccio/master/packages/config/src/conf/docker.yaml -O config.yaml
Postavite configMap
na klaster
storage: /verdaccio/storage/data
auth:
htpasswd:
file: /verdaccio/storage/htpasswd
Deploy the configMap
Sada možete postaviti Verdaccio Helm chart i detaljno definisati konfiguraciju da koristi:
kubectl create configmap verdaccio-config --from-file ./config.yaml
Deploy Verdaccio
Rancher je kompletna container management platforma koja Vam omogućava da na lak i jednostavan način koristite kontejnere.
helm install npm --set existingConfigMap=verdaccio-config verdaccio/verdaccio
Authenticate with private upstreams using Helm
As of version 4.8.0
of the helm chart, a new secretEnvVars
field has been added.
This allows you to inject sensitive values to the container via a Kubernetes Secret.
- Update your Verdaccio config according to the Uplinks documentation
- Pass the secret environment variable to your values file or via
--set secretEnvVars.FOO_TOKEN=superSecretBarToken
# values.yaml
secretEnvVars:
FOO_TOKEN: superSecretBarToken
NGINX proxy body-size limit
The standard k8s NGINX ingress proxy allows for 1MB for body-size which can be increased by modifying the default deployment options according to the documentation:
...
annotations:
...
kubernetes.io/proxy-body-size: 20m
....
...
Rancher Support
Rancher is a complete container management platform that makes managing and using containers in production really easy.