Verdaccio is a lightweight private Node.js proxy registry.
$ helm repo add verdaccio https://charts.verdaccio.org
$ helm repo update
$ helm install verdaccio verdaccio/verdaccio
⚠️ If you are using stable/verdaccio chart, be aware is deprecated, forward all new PR and or issues to this repository.
If you need support for Helm v2, please use
<=v0.19.0, be aware we do not support Helm v2 anymore.
This chart bootstraps a Verdaccio deployment on a Kubernetes cluster using the Helm package manager.
- Kubernetes 1.7+ with Beta APIs enabled
- PV provisioner support in the underlying infrastructure
helm repo add verdaccio https://charts.verdaccio.org
In this example we use npm as release name:
# Helm v3+
helm install npm verdaccio/verdaccioNote: Avoid release name
verdaccio, otherwise, Kubernetes-generated environment variables may get into conflict with Verdaccio's own environment variables in the Pod itself. In case you insist naming the releaseverdaccio, to mitigate the problem, you can use eithernameOverrideorfullnameOverrideto have a different name for the service.
# Helm v3+
helm install npm --set image.tag=7.0.0 verdaccio/verdaccioChart 7.0.0 and later deploy Verdaccio 7. To stay on the Verdaccio 6.x
line, pin the image or the chart:
# Verdaccio 6.x image with the current chart
helm install npm --set image.tag=6.11.1 verdaccio/verdaccio
# or the last chart of the 4.x series
helm install npm --version 4.36.0 verdaccio/verdacciohelm upgrade npm verdaccio/verdaccioThe command deploys Verdaccio on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
Tip: List all releases using
helm list
To uninstall/delete the npm deployment:
# Helm v3+
helm uninstall npmThe command removes all the Kubernetes components associated with the chart and deletes the release.
The following table lists the configurable parameters of the Verdaccio chart and their default values.
Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,
# Helm v3+
$ helm install my-release \
--set service.type=LoadBalancer \
verdaccio/verdaccioThe above command sets the service type LoadBalancer.
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
# Helm v3+
$ helm install npm -f values.yaml verdaccio/verdaccioTip: You can use the default values.yaml
This requires helm v3.2.0 or above. You can list all username and password in
.Values.secrets.htpasswd. Helm will generate secret with htpaswd format. This
file is mounted on pod in this path /verdaccio/auth/htpasswd. The Default
config uses this. The conditional statement {{- if .Values.secrets.htpasswd }}
is evaluated as false if the list is an empty collection.
(Source helm flow control)
Tip: These values are in plaintext. So don't forget to put additional encryption.
secrets:
# list of users and password for htpasswd plugin
# This this is mounted as /verdaccio/auth/htpasswd on pods
htpasswd:
- username: "verdaccio"
password: "verdaccio"This config will create a htpasswd file with user "verdaccio", If in config 'htpasswd' auth is used. You can login using this credentials.
Instead of providing plain text credentials in values.yaml, you can reference an
existing Kubernetes secret containing the htpasswd file. This is more secure as it
avoids storing passwords in plain text in your values files.
When secrets.existingSecretHtpasswd is set, the chart will use the specified
secret instead of generating one from secrets.htpasswd. The secret must contain
a key with the htpasswd file content (default key: htpasswd, configurable via
secrets.existingSecretHtpasswdKey).
secrets:
# Reference an existing secret instead of providing plain text credentials
existingSecretHtpasswd: "my-htpasswd-secret"
existingSecretHtpasswdKey: "htpasswd" # Optional, defaults to "htpasswd"The existing secret should contain the htpasswd file content in the specified key. You can create such a secret using:
kubectl create secret generic my-htpasswd-secret \
--from-file=htpasswd=/path/to/htpasswdNote: If both
secrets.htpasswdandsecrets.existingSecretHtpasswdare set,secrets.existingSecretHtpasswdtakes precedence and no secret will be generated fromsecrets.htpasswd.
Important: When using an existing secret, pods will not automatically restart when the secret content is updated. This is a limitation of Kubernetes - it doesn't track changes to external secrets. You need to manually trigger a pod restart after updating the secret:
kubectl rollout restart deployment/<release-name>-verdaccio
As an alternative to traditional Ingress, this chart supports creating an HTTPRoute resource for use with the Gateway API. This requires a Gateway API implementation (e.g., Envoy Gateway, Istio, Cilium, nginx-gateway-fabric) and a Gateway resource already deployed in your cluster.
gatewayApi:
enabled: true
parentRefs:
- name: my-gateway
namespace: default
hostnames:
- npm.example.comNote: The chart only creates an
HTTPRoute— theGatewayresource itself should be managed separately as cluster infrastructure. BothingressandgatewayApican coexist if needed during migration.
When creating a new chart with this chart as a dependency, CustomConfigMap can
be used to override the default config.yaml provided. It also allows for
providing additional configuration files that will be copied into
/verdaccio/conf. In the parent chart's values.yaml, set the value to true and
provide the file templates/config.yaml for your use case.
The Verdaccio image stores persistence under /verdaccio/storage path of the
container. A dynamically managed Persistent Volume Claim is used to keep the
data across deployments, by default. This is known to work in GCE, AWS, and
minikube.
Alternatively, a previously configured Persistent Volume Claim can be used.
It is possible to mount several volumes using Persistence.volumes and
Persistence.mounts parameters.
- Create the PersistentVolume
- Create the PersistentVolumeClaim
- Install the chart
# Helm v3+
$ helm install npm \
--set persistence.existingClaim=PVC_NAME \
verdaccio/verdaccioDue to some breaking changes in Selector Labels and Security Contexts in Chart 3.0.0 you will need to migrate when upgrading.
First off, the securityContext.enabled field has been removed.
In addition to this, fsGroup is not a valid Container Security Context field and has been migrated to the podSecurityContext instead.
# values.yaml
podSecurityContext:
+ fsGroup: 101
securityContext:
- enabled: true
- fsGroup: 101
runAsUser: 10001Secondly, the apps.v1.Deployment.spec.selector field is immutable and changes were made to Selector Labels which tries to update this.
To get around this, you will need to kubectl delete deployment $deploymentName before doing a helm upgrade
So long as your PVC is not destroyed, the new deployment will be rolled out with the same PVC as before and your data will remain intact.
Due the major release Verdaccio 5 has some breaking changes to be aware of, please read the migration guide here.
Chart 7.0.0 moves the default image to Verdaccio 7 (appVersion: 7.0.0);
the chart major now follows the Verdaccio major. The chart templates and values
are unchanged, but Verdaccio 7 has breaking changes for the registry itself:
read the Verdaccio 6 to 7 migration guide
and the release post
before upgrading. To stay on 6.x, pin image.tag to a 6.x version or install
chart 4.36.0.
