0

I have a program that launches a job using Job Controller. Due to some ops configuration errors the Pod is not able to pull the image from registry correctly.

I initially expect the Pod's status will go to "Failed", but turns out it stucks in "Pending" state forever. I initially thought I might be able to implement livenessProbe in the main container and set the timeout there, but since my init container is still waiting: ImagePullBackOff, the probe won't even start.

I wonder without inspection into the pod, is there a way to notify the Pod to fail when it fails to pull the image, e.g. setting a timeout or retry limit.

7
  • 1
    Possible duplicate of Pods stuck in PodInitializing state indefinitely Mar 12, 2019 at 20:46
  • @cookiedough The error in that question was due to init container failure. This is failing even before init container started, so I can't use livenessProbe.
    – user10945697
    Mar 12, 2019 at 20:51
  • If the init container is getting an ImagePullBackOff error that is also an init container failure. As you can see in the answers to the other question, the pod will be waiting until the init container succeeds based on the container restart policy. Mar 12, 2019 at 20:55
  • I guess is there a way to catch this failure so that the Pod can result in a "Failed" state instead of Pending. I tried to add a livenessProbe to the main container, but it didn't work probably. kubernetes.io/docs/concepts/workloads/pods/init-containers says Use activeDeadlineSeconds on the Pod and livenessProbe on the Container to prevent Init Containers from failing forever. I'm not sure how that works.
    – user10945697
    Mar 12, 2019 at 22:08
  • How can it be re-created? For me it never goes to "Pending" sukhoversha@sukhoversha:~/GCP$ kk get pods --watch NAME READY STATUS RESTARTS AGE webapp1 0/1 ImagePullBackOff 0 49s webapp1 0/1 ErrImagePull 0 1m webapp1 0/1 ImagePullBackOff 0 1m
    – A_Suh
    Mar 13, 2019 at 9:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.