Kubernetes

You try to run a Pod but see the status "CrashLoopBackOff". What does it means? How to identify the issue?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

The container failed to run (due to different reasons) and Kubernetes tries to run the Pod again after some delay (= BackOff time).

Some reasons for it to fail:

  • Misconfiguration - misspelling, non supported value, etc.
  • Resource not available - nodes are down, PV not mounted, etc.

Some ways to debug:

  1. kubectl describe pod POD_NAME
    1. Focus on State (which should be Waiting, CrashLoopBackOff) and Last State which should tell what happened before (as in why it failed)
  2. Run kubectl logs mypod
    1. This should provide an accurate output of
    2. For specific container, you can add -c CONTAINER_NAME
  3. If you still have no idea why it failed, try kubectl get events