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

前端 未结 9 1462
梦毁少年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:36

    By default Kubernetes looks in the public Docker registry to find images. If your image doesn't exist there it won't be able to pull it.

    You can run a local Kubernetes registry with the registry cluster addon.

    Then tag your images with localhost:5000:

    docker tag aii localhost:5000/dev/aii
    

    Push the image to the Kubernetes registry:

    docker push localhost:5000/dev/aii
    

    And change run-aii.yaml to use the localhost:5000/dev/aii image instead of aii. Now Kubernetes should be able to pull the image.

    Alternatively, you can run a private Docker registry through one of the providers that offers this (AWS ECR, GCR, etc.), but if this is for local development it will be quicker and easier to get setup with a local Kubernetes Docker registry.

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

    I had the same problem what caused it was that I already had created a pod from the docker image via the .yml file, however I mistyped the name, i.e test-app:1.0.1 when I needed test-app:1.0.2 in my .yml file. So I did kubectl delete pods --all to remove the faulty pod then redid the kubectl create -f name_of_file.yml which solved my problem.

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

    One issue that may cause an ImagePullBackOff especially if you are pulling from a private registry is if the pod is not configured with the imagePullSecret of the private registry.

    An authentication error may cause an imagePullBackOff.

    0 讨论(0)
提交回复
热议问题