Kubernetes
Możesz znaleźć instrukcje wdrażania Verdaccio w grupie Kubernetes w magazynie verdaccio/docker-example. Jednakże, zalecana metoda do instalacji Verdaccio na Kubernetes grupie jest do użycia Helm. Helm jest Kubernetes menedżerem pakietów, który przynosi wiele korzyści.
Helm
Setup Helm
Jeśli nie używałeś wcześniej Helm, musisz ustawić kontroler Helm zwany Tiller:
helm init
Install
⚠️ If you are using this helm chart, please be aware of the migration of the repository.
Rozmieść Helm wykres stable/verdaccio W tym przykładzie używamy npm
jako nazwa wydania:
Add repository
helm install --name npm stable/verdaccio
Note: te polecenie usuwa wszystkie zasoby, w tym pakiety, które mógłbyś wcześniej opublikować w rejestrze.
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
Odinstalowywanie
wget https://raw.githubusercontent.com/verdaccio/verdaccio/master/conf/docker.yaml -O config.yaml
Możesz dostosować konfigurację Verdaccio za pomocą Kubernetes configMap.
Niestandardowa konfiguracja Verdaccio
Copy the existing configuration and adapt it for your use case:
Prepare
Note: Upewnij się, że używasz właściwej ścieżki do pamięci, która jest używana do utrzymywania:
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
Rancher jest kompletnym kontenerem platformy zarządzania, który sprawia, że zarządzanie i używanie kontenerów w produkcji jest naprawdę łatwe.
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.