Skip to main content

Kubernetes

The recommended way to run Verdaccio on Kubernetes is the official Helm chart, maintained at verdaccio/charts.

Start from the worked example

The repository ships a complete, runnable example — a values.yaml with its own README, covering persistence, resource limits, an Ingress block ready to uncomment, and an inline config.yaml. Copying that and editing it is usually faster than assembling the flags on this page one at a time.

It is part of the Docker and Kubernetes examples, grouped by the major version they target: v6 for the current stable line, v7 for the next major, v9 for the experimental one. The example above pins the 7.x-next image; change image.tag to 6 to run the stable line instead.

Helm​

Helm 3 is what these instructions assume. It needs no cluster-side component — the helm init and Tiller setup of Helm 2 is gone, and so is Helm 2 itself.

Install​

Deploy the Helm verdaccio/verdaccio chart.

Add repository​

helm repo add verdaccio https://charts.verdaccio.org

In this example we use npm as release name:

helm install npm verdaccio/verdaccio

Deploy a specific version​

image.tag selects the Verdaccio image, and pinning it is what you want in production:

helm install npm --set image.tag=6 verdaccio/verdaccio # latest 6.x
helm install npm --set image.tag=6.10.3 verdaccio/verdaccio # exactly this release
helm install npm --set image.tag=7.x-next verdaccio/verdaccio # nightly of the next major

See Docker for what each tag means.

Upgrading Verdaccio​

helm upgrade npm verdaccio/verdaccio

Uninstalling​

helm uninstall 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 and adapt it for your use case:

wget https://raw.githubusercontent.com/verdaccio/verdaccio/master/packages/config/src/conf/docker.yaml -O config.yaml

Note: Make sure you are using the right path for the storage that is used for persistency:

storage: /verdaccio/storage/data
auth:
htpasswd:
file: /verdaccio/storage/htpasswd

Deploy the configMap​

Deploy the configMap to the cluster

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:

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.

  1. Update your Verdaccio config according to the Uplinks documentation
  2. 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.