Kubernetes

After running kubectl run database --image mongo you see the status is "CrashLoopBackOff". What could possibly went wrong and what do you do to confirm?

Difficulty: unrated

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

Answer

"CrashLoopBackOff" means the Pod is starting, crashing, starting...and so it repeats itself.

There are many different reasons to get this error - lack of permissions, init-container misconfiguration, persistent volume connection issue, etc.

One of the ways to check why it happened it to run kubectl describe po and having a look at the exit code

 Last State:     Terminated
   Reason:       Error
   Exit Code:    100

Another way to check what's going on, is to run kubectl logs . This will provide us with the logs from the containers running in that Pod.