cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 8,516 Views

ImagePullBackOff & ErrImagePull in K8s

Kubernetes will set a container's state to  ImagePullBackOff  if it is unable to pull an image. After a grace period, the kubelet will attempt to extract the image once more with a longer back-off time. This status is comparable to the CrashLoopBackOff  status, which is a respite between retries following a container fault. 

It's crucial to understand that ImagePullBackOff is NOT a bug. Simply put, it is a status reason that denotes an issue with pulling a image. Until the image is successfully pulled or the allotted number of retries has been reached, the kubelet will keep trying to pull the image.

Here, I have the same "error" :

Chetan_Tiwary__0-1690394139377.png

what does it say : 

  • Pod is NOT READY - depicted as 0/1
  • STATUS is ImagePullBackOff 
  • RESTARTS as 0 - NO restart since pod is not even started

 

Let's  do a log check for this pod and see what it says :

Chetan_Tiwary__1-1690394396829.png

Bad request : container is watiting to start : trying and failing to "pull image"

( quite self-explanatory isn't it ? ).

 

Now let us see the events if it can tell us something similar :

Chetan_Tiwary__2-1690394625043.png

Two things :

  1. Error : ErrImagePull
  2. Error : ImagePullBackOff

When kubelet tries to start a container in the pod but encounters an issue with the image specified in your Pod / Deployment : the status ErrImagePull is shown.

Kubernetes initially throws the ErrImagePull error, and then after retrying a few times, “pulls back” and schedules another download attempt.

 

Note the message in the events log : failed to pull image ...rpc error.....unkown manifest.

Same thing can be checked in oc describe pod <pod-name> also : 

Chetan_Tiwary__3-1690395083136.png

Now what went wrong ?

This can happen when you have provided :

  • An incorrect image URL 
  • Incorrect image tag 
  • Incorrect or spelling mistake in the image name
  • Corrupt image manifest
  • Image repo has been removed or is not available
  • Network connection disruption 
  • Trying to pull from a private registry 

You will have to troubleshoot this based on the oc logs/events/describe command shown above. Ensure that name and URL of the image is correct and you can authenticate to the registry and can pull from it. If the network issue is there , restore the network connectivity and then retry - it will work.

 

 

0 Replies
Join the discussion
You must log in to join this conversation.