top of page
  • Writer's pictureNana Janashia

How to pull image from private Docker Registry in Kubernetes cluster ๐Ÿค”


How do you get Docker images  in your Kubernetes cluster ?

The question ๐Ÿค”

How do you get Docker images ๐Ÿณ in your Kubernetes cluster from private Docker registries like AWS ECR, Nexus, etc?


Context

For images like MongoDB and Elastic, which are hosted on Docker Hub, itโ€™s straightforward, because they are hosted in a public repository, and anyone can access them.


But your own application image is stored in a private repository and needs explicit access from the cluster. So how do you pull the application images from your private docker repository on the Kubernetes cluster?


How to do it ๐Ÿ™Œ๐Ÿผ

There are 2 steps to take to achieve it.


1) You create a Secret component that contains access tokens/credentials to your Docker registry.


Example Secret config:

Secret component
Secret component

2) You configure your Deployment component to use that secret using a specific imagePullSecrets attribute.


Example Deployment config:

Deployment component
Deployment component

Note: Pods can only reference image pull secrets in their own namespace, so this process needs to be done one time per namespace!


In the demo video ๐ŸŽฌ I show you the whole process step by step:


ย 

Want to become a Kubernetes administrator?

Then, check out this comprehensive and practical course to become a Kubernetes administrator and master the Certified Kubernetes Administrator exam ๐Ÿš€:



1,142 views0 comments

Recent Posts

See All
bottom of page