Interview Prep/Kubernetes/Pod startup failures

A Pod shows `CrashLoopBackOff` with `RESTARTS 7` and events say `Back-off restarting failed container app`. Where do you start?

BeginnerTroubleshootingPod startup failures
Answer

Likely causes → The container starts and exits: application error, missing env var or config, failed DB connection at boot, wrong command, or an OOM kill. CrashLoopBackOff is a symptom, not a cause; kubelet just backs off restarts (10s, 20s, 40s … capped at 5 minutes).

Diagnose →

kubectl describe pod web-7d9f8c-x2k4q        # Last State, Reason, Exit Code
kubectl logs web-7d9f8c-x2k4q --previous     # logs of the crashed instance
kubectl get pod web-7d9f8c-x2k4q -o jsonpath='{.status.containerStatuses[0].lastState}'

Fix → Act on the exit code and the last log lines: fix the config, the Secret, the command, or raise the memory limit if Reason: OOMKilled.

Prevent → Fail fast with a clear log line on bad config, validate manifests in CI, and alert on kube_pod_container_status_restarts_total increasing.

All Kubernetes questions Roadmap: Kubernetes core

More on Pod startup failures