/default-imagepullsecrets

The admission controller that applies default imagePullSecrets to pods

Primary LanguageGoApache License 2.0Apache-2.0

default-imagepullsecrets

The admission controller that applies default imagePullSecrets to pods.

Getting Started

Install cert-manager

default-imagepullsecrets uses cert-manager for certificate management of Admission Webhook. Make sure you have already installed cert-manager before you start.

Deploy default-imagepullsecrets

export VERSION=latest
export DEFAULT_IMAGEPULLSECRETS="mysecret0,my-secret1"
envsubst < default-imagepullsecrets.yaml | kubectl apply -f -

# Wait for default-imagepullsecrets to be rollout
kubectl rollout status -n default-imagepullsecrets deployment default-imagepullsecrets

# Deploy MutatingWebHookConfiguration
kubectl apply -f mutating-webhook-configuration.yaml
# Run a test pod
kubectl run test --image=nginx
# Make sure that default imagePullSecrets are applied
kubectl get pods test -o jsonpath='{.spec.imagePullSecrets}{"\n"}'

Clean up

kubectl delete -f mutating-webhook-configuration.yaml

export VERSION=latest
export DEFAULT_IMAGEPULLSECRETS="mysecret0,my-secret1"
envsubst < default-imagepullsecrets.yaml | kubectl delete -f -