Doc : https://kubernetes.io/fr/docs/tasks/configure-pod-container/pull-image-private-registry
Create docker-registry secret :
read -s -p "Type the registry password : " REGISTRY_PASSWORD
REGISTRY_USERNAME=<username>
REGISTRY_SERVER=<registry-server>
REGISTRY_USER_EMAIL=<your-email>
kubectl create secret docker-registry my-regcred \
--dry-run client -o yaml \
--docker-server=$REGISTRY_SERVER \
--docker-username=$REGISTRY_USERNAME \
--docker-password=$REGISTRY_PASSWORD \
--docker-email=$REGISTRY_USER_EMAIL > my-regcred.yaml
To check whether the tiller
account has the right to create a ServiceMonitor
object on staging
namespace:
kubectl auth can-i create servicemonitor --as=system:serviceaccount:staging:tiller -n staging