loading...
Cover image for How to pull image from private Docker Registry in Kubernetes cluster πŸ€”

How to pull image from private Docker Registry in Kubernetes cluster πŸ€”

techworld_with_nana profile image Techworld with Nana ・1 min read

kubernetes video (15 Part Series)

1) Kubernetes simply explained for beginners 2) The only Kubernetes video you need to watch to understand more about K8s than most developers πŸ’ͺ🏼 3 ... 13 3) Kubernetes Architecture simply explained 4) How Kubernetes makes high availability, scalability, disaster recovery possible? - with simple animations 🀩 5) What is Minikube and Kubectl? πŸ€” Setup a Minikube cluster for Kubernetes Beginners 6) Kubectl Basic Commands | How to create and debug a pod in a Minikube cluster 😏 7) Kubernetes YAML File simply explained for Beginners 8) Complete Guide to setting up your Application using Kubernetes Components 9) Kubernetes Namespaces Explained in 15 mins 10) Kubernetes Ingress Tutorial for Beginners πŸ™ŒπŸΌ 11) What is Helm in Kubernetes? πŸ€·πŸ»β€β™‚οΈ 12) Kubernetes Pods vs Containers | K8s Networking Basics πŸ’‘ 13) ConfigMap and Secret as Kubernetes Volumes?! πŸ€” 14) How to pull image from private Docker Registry in Kubernetes cluster πŸ€” 15) Deployment vs StatefulSet | Kubernetes StatefulSet simply explained

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, Elastic, that 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 lives 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 Kubernetes cluster?

How to do it πŸ™ŒπŸΌ

There are 2 steps to take to achieve it.

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

Example Secret config:
Secret component

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

Example Deployment config:
Deployment component

Note: Pods can only reference imagePullSecrets 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:

Hope it's helpful some of you πŸ™‚


I'm excited to host my first *LIVE Webinar on Kubernetes * πŸ€“ πŸ‘©πŸ»β€πŸ’»

Date: The webinar is on Saturday June 13, 2020
Topic: Deploy Elasticsearch StatefulSet and Kibana with Helm on a Cloud platform

kubernetes video (15 Part Series)

1) Kubernetes simply explained for beginners 2) The only Kubernetes video you need to watch to understand more about K8s than most developers πŸ’ͺ🏼 3 ... 13 3) Kubernetes Architecture simply explained 4) How Kubernetes makes high availability, scalability, disaster recovery possible? - with simple animations 🀩 5) What is Minikube and Kubectl? πŸ€” Setup a Minikube cluster for Kubernetes Beginners 6) Kubectl Basic Commands | How to create and debug a pod in a Minikube cluster 😏 7) Kubernetes YAML File simply explained for Beginners 8) Complete Guide to setting up your Application using Kubernetes Components 9) Kubernetes Namespaces Explained in 15 mins 10) Kubernetes Ingress Tutorial for Beginners πŸ™ŒπŸΌ 11) What is Helm in Kubernetes? πŸ€·πŸ»β€β™‚οΈ 12) Kubernetes Pods vs Containers | K8s Networking Basics πŸ’‘ 13) ConfigMap and Secret as Kubernetes Volumes?! πŸ€” 14) How to pull image from private Docker Registry in Kubernetes cluster πŸ€” 15) Deployment vs StatefulSet | Kubernetes StatefulSet simply explained

Posted on Jun 1 by:

techworld_with_nana profile

Techworld with Nana

@techworld_with_nana

DevOps Consultant | YouTuber 🎬 | Software Engineer πŸ‘©πŸ»β€πŸ’» Based in Austria πŸ‡¦πŸ‡Ή

Discussion

markdown guide
 

Hi Nana, thank you so much for the excellent content.

You added "imagePullPolicy: Always" to force docker download the image because you had it in your host already.

I think it wouldn't matter since the Docker pulling the image is the one inside minikube, not the one running in your host.

Am I understanding this correctly?

Thanks!