1

I'm new to Kubernetes and learning it these days. I'm trying to create a deployment with the help of kubectl and every time I create a deployment, the container is not running and I get ErrImagePull or ImagePullBackOff.

I have tried on two machines, both have the same problem.

kubectl create deployment nginx-depl --image=nginx

Following is the description of one of the deployments I was creating

Events:
  Type     Reason     Age   From               Message
  ----     ------     ----  ----               -------
  Normal   Scheduled  23s   default-scheduler  Successfully assigned default/nginx-85b98978db-z6b2n to minikube
  Normal   Pulling    22s   kubelet            Pulling image "nginx"
  Warning  Failed     7s    kubelet            Failed to pull image "nginx": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed     7s    kubelet            Error: ErrImagePull
  Normal   BackOff    7s    kubelet            Back-off pulling image "nginx"
  Warning  Failed     7s    kubelet            Error: ImagePullBackOff

David Maze
  • 130,717
  • 29
  • 175
  • 215
Rehan Sattar
  • 3,497
  • 4
  • 13
  • 21
  • This seems like it's some sort of networking issue in your cluster and not related to your deployment setup or any code you've written. The cluster is trying to connect to Docker Hub and failing. Resolving that isn't the sort of programming question that's on-topic for Stack Overflow. The [help/on-topic] describes what's appropriate here. – David Maze Apr 22 '22 at 10:14
  • Thanks, @DavidMaze for your reply. I'm sorry but I don't have any other option to go for other than the stack overflow in my mind right now. The networking is working, I can pull and push all the images from docker but when I'm doing it from the kubectl, it's failing. – Rehan Sattar Apr 22 '22 at 10:18

1 Answers1

-1

Looks like you dont have internet connectivity from the cluster nodes. kubelet on the node is trying to pull the docker image from https://registry-1.docker.io/v2/ but connectivity is not established and was timed out. hence you are getting ImagePullBackOff Error

P Ekambaram
  • 15,499
  • 7
  • 34
  • 59