Run a multi-replica Verdaccio registry on Kubernetes with the Google Cloud Storage + Datastore storage plugin, fully backed by local emulators — no GCP account needed.
From the repo root:
docker build -t verdaccio-google-cloud:local .Load it into your local cluster:
# minikube
eval $(minikube docker-env)
docker build -t verdaccio-google-cloud:local .
# kind
kind load docker-image verdaccio-google-cloud:local
# Docker Desktop
# No extra step needed — images are sharedkubectl apply -f emulators.yamlWait for them to be ready:
kubectl -n gcp-emulators rollout status deployment/fake-gcs-server
kubectl -n gcp-emulators rollout status deployment/datastore-emulatorkubectl apply -f init-resources.yamlWait for the job to complete:
kubectl -n gcp-emulators wait --for=condition=complete job/init-gcp-resources --timeout=60shelm repo add verdaccio https://charts.verdaccio.org
helm repo update
helm install verdaccio verdaccio/verdaccio -f values.yaml# Check pods
kubectl get pods -l app.kubernetes.io/name=verdaccio
# Check plugin loaded
kubectl logs -l app.kubernetes.io/name=verdaccio | grep "google-cloud"
# Port-forward
kubectl port-forward svc/verdaccio 4873:4873In another terminal:
# Ping
curl http://localhost:4873/-/ping
# Add user
npm adduser --registry http://localhost:4873
# Create and publish a test package
mkdir /tmp/helm-test && cd /tmp/helm-test
echo '{"name":"helm-test-pkg","version":"1.0.0"}' > package.json
npm publish --registry http://localhost:4873
# Verify it's stored
curl -s http://localhost:4873/helm-test-pkg | jq .nameEdit values.yaml and change replicaCount, or:
kubectl scale deployment verdaccio --replicas=3All replicas share the same GCS bucket and Datastore database via the emulators.
# Port-forward fake-gcs-server
kubectl -n gcp-emulators port-forward svc/fake-gcs-server 5050:5050
# List GCS objects
curl -s http://localhost:5050/storage/v1/b/verdaccio-storage/o | jq '.items[].name'
# Port-forward Datastore emulator
kubectl -n gcp-emulators port-forward svc/datastore-emulator 8081:8081
# Set emulator host for Datastore clients
export DATASTORE_EMULATOR_HOST=localhost:8081helm uninstall verdaccio
kubectl delete -f init-resources.yaml
kubectl delete -f emulators.yaml| File | Description |
|---|---|
values.yaml |
Helm values for Verdaccio — 2 replicas, emulator endpoints, trace logging |
emulators.yaml |
Deployment + Service for fake-gcs-server and Datastore emulator in their own namespace |
init-resources.yaml |
Job that creates the GCS bucket in fake-gcs-server |