Vagrant Kubernetes Docker Pull access denied to a tag I create from image that is direct from docker hub

8/8/2020

So I have this problem that no matter what I try I get the error below. I know that there are numerous things on this same issue but I have tried everything I see there.

So here is my setup. Vagrant -> creates 4 nodes (1 Master, 3 nodes) -> puts kubernetes on each then I performed the same thing on all 4 machines just to see if it worked. 1) document login (successful to my dockerhub account) 2) docker pull nginx 3) docker tag nginx nginxy (notice the y) 4) On Master I run my ngin-deployment.yaml file with image: nginxy

Below is the error EVERYTIME! The funny thing is it only happens on images that I tag. if I use just "nginx" it works. Notice that I can see the tag on all machines and I login. So I believe I meet the requirements of the ERROR. I thought that only master should have the images but put it in all nodes after nothing worked.

Normal   Scheduled  <unknown>              default-scheduler  Successfully assigned default/gyrex- deployment-58f44bf77f-9h6tg to node2
Normal   Pulling    2m34s (x4 over 4m11s)  kubelet, node2     Pulling image "nginxy:latest"
Warning  Failed     2m33s (x4 over 4m10s)  kubelet, node2     Failed to pull image "nginxy:latest": rpc error: code = Unknown desc = Error response from daemon: pull access denied for nginxy, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
Warning  Failed     2m33s (x4 over 4m10s)  kubelet, node2     Error: ErrImagePull

I went thru this tutorial completely but nothing works. https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-repository

-- user3008410
docker
kubernetes
vagrant

1 Answer

8/9/2020

Try adding the imagePullPolicy: Never to the spec section in your container spec in the YAML file.

-- pacuna
Source: StackOverflow