I am planning to deploy an application in my kubernetes-clustering infra. I pushed image to dockerhub repo. How can I pull image from dockerhub?
One line command to create a Docker registry secret
kubectl create secret docker-registry regcred --docker-username= --docker-password= --docker-email= -n
Then you can use it in your deployment file under spec
spec:
containers:
- name: private-reg-container-name
image:
imagePullSecrets:
- name: regcred
More details: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#create-a-secret-in-the-cluster-that-holds-your-authorization-token