How to Use Private Images

Follow these steps if you need to use private images when deploying your applications or development environments.

First, create a docker-registry secret with your registry credentials:

kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>

More information on how to create docker-registrysecrets is available here.

With the secret created, update your service account to automatically inject the registry secret when deploying resources in the namespace:

kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "regcred"}]}'

If your resources use a different serviceAccountName, replace default with that value in the command above.

With this configuration, all the deployments, stateful sets, jobs and development environments launched in your namespace will automatically use your registry credentials when pulling private images.