What is the meaning of ImagePullBackOff status on a Kubernetes pod?

前端 未结 9 1461
梦毁少年i
梦毁少年i 2021-02-02 04:49

I\'m trying to run my first kubernetes pod locally. I\'ve run the following command (from here):

export ARCH=amd64
docker run -d \\
    --volume=/:/rootfs:ro \\
         


        
相关标签:
9条回答
  • 2021-02-02 05:27

    I had this error when I tried to create a replicationcontroller. The issue was, I wrongly spelt the nginx image name in template definition.

    Note: This error occurs when kubernetes is unable to pull the specified image from the repository.

    0 讨论(0)
  • 2021-02-02 05:28

    You can specify also imagePullPolicy: Never in the container's spec:

    containers:
    - name: nginx
      imagePullPolicy: Never
      image: custom-nginx
      ports:
      - containerPort: 80
    
    0 讨论(0)
  • 2021-02-02 05:28

    The issue arises when the image is not present on the cluster and k8s engine is going to pull the respective registry. k8s Engine enables 3 types of ImagePullPolicy mentioned :

    1. Always : It always pull the image in container irrespective of changes in the image
    2. Never : It will never pull the new image on the container
    3. IfNotPresent : It will pull the new image in cluster if the image is not present.

    Best Practices : It is always recommended to tag the new image in both docker file as well as k8s deployment file. So That it can pull the new image in container.

    0 讨论(0)
  • 2021-02-02 05:29

    Despite all the other great answers none helped me until I found a comment that pointed out this Updating images:

    The default pull policy is IfNotPresent which causes the kubelet to skip pulling an image if it already exists.

    That's exactly what I wanted, but didn't seem to work.

    Reading further said the following:

    If you would like to always force a pull, you can do one of the following:

    • omit the imagePullPolicy and use :latest as the tag for the image to use.

    When I replaced latest with a version (that I had pushed to minikube's Docker daemon), it worked fine.

    $ kubectl create deployment presto-coordinator \
        --image=warsaw-data-meetup/presto-coordinator:beta0
    deployment.apps/presto-coordinator created
    
    $ kubectl get deployments
    NAME                 READY   UP-TO-DATE   AVAILABLE   AGE
    presto-coordinator   1/1     1            1           3s
    

    Find the pod of the deployment (using kubectl get pods) and use kubectl describe pod to find out more on the pod.

    0 讨论(0)
  • 2021-02-02 05:30

    I had similar problem when using minikube over hyperv with 2048GB memory. I found that in HyperV manager the Memory Demand was higher than allocated.

    So I stopped minikube and assigned somewhere between 4096-6144GB. It worked fine after that, all pods running!

    I don't know if this can nail down the issue in every case. But just have a look at the memory and disk allocated to the minikube.

    0 讨论(0)
  • 2021-02-02 05:32

    I too had this problem, when I checked I image that I was pulling from a private registry was removed If we describe pod it will show pulling event and the image it's trying to pull

    kubectl describe pod <POD_NAME>
    
    Events:
     Type     Reason   Age                  From              Message
     ----     ------   ----                 ----              -------
     Normal   Pulling  18h (x35 over 20h)   kubelet, gsk-kub  Pulling image "registeryName:tag"
     Normal   BackOff  11m (x822 over 20h)  kubelet, gsk-kub  Back-off pulling image "registeryName:tag"
     Warning  Failed   91s (x858 over 20h)  kubelet, gsk-kub  Error: ImagePullBackOff
    
    
    0 讨论(0)
提交回复
热议问题