K8S on Docker Desktop cannot pull private repo - pull access denied

2/24/2021

I have logged in to the Docker hub using the CLI command: docker login. Entered username and password and I can pull and push images to Docker hub.

However, my K8S can't. I am trying to apply a deployment that should pull those images into its pods but I got the following error when running kubectl describe pod POD_NAME:

  Warning  Failed     9s    kubelet            Failed to pull image "myprivate/repo:tag": rpc error: code = Unknown desc = Error response from daemon: pull access denied for myprivate/repo, repository does not exist or may require 'docker login': denied: requested access to the resource is denied

How to make the docker run in the pods to also be logged to the docker hub as well as doing it from my terminal?

-- Raz Buchnik
docker
dockerhub
kubernetes

1 Answer

2/24/2021

Create "image pull secret" and define on your deployment. Here is how you can do https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

-- Mustafa Güler
Source: StackOverflow