Kubernetes: Pulling Image From Private Registry

Create the Secret for you docker registry:

Shell

To double check:

Shell

Create a test pod:

Shell

For pod, setting the imagePullSecrets only available using the –overrides flag when you create the pod. After the pod is created, you cannot edit the imagePullSecrets using kubectl edit or patch.

DEPLOYMENT

You can edit the deployment manifest and add the following at line 9, 10:

YAML

Or you can always kubectl patch. Use flag --type strategic (default) to append or --type merge to replace.

Shell

SERVICE ACCOUNT

The easiest way to attach the imagePullSecrets is in your ServiceAccount:

YAML

REFERENCES:


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *