A pod is in CrashLoopBackOff. You have 10 minutes. Walk through your commands.
BeginnerHands-onLive debugging tasks
Answer
kubectl get pod api-7d9f -o wide
kubectl describe pod api-7d9f # Events, Last State, Exit Code, Reason
kubectl logs api-7d9f --previous # logs of the crashed container, not the new one
kubectl get pod api-7d9f -o jsonpath='{.status.containerStatuses[0].lastState.terminated}'
Read the exit code: 1 = app error (check the logs), 137 = SIGKILL (often OOMKilled, see Reason), 127 = command not found, 126 = not executable.
Key trick → --previous is the flag people forget. Without it you see logs of the container that just started and has nothing useful yet.
More on Live debugging tasks
The pod shows `OOMKilled`. Diagnose and fix it.BeginnerA pod is stuck in `ImagePullBackOff`. Fix it.BeginnerA pod is `Pending` forever. What do you check?AdvancedThe Service returns "connection refused" but pods are Running. Debug it.IntermediateA Docker container exits immediately after `docker run -d`. Find out why.Beginner`docker build` fails with "COPY failed: file not found in build context". Fix it.Beginner