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.
More on Pod startup failures
`kubectl logs web-0 --previous` returns nothing useful and the container dies in under a second. How do you get inside it?IntermediatePod status is `ImagePullBackOff` and events show `Failed to pull image "registry.example.com/web:1.4.2": rpc error: code = NotFound desc = failed to pull and unpack image ... not found`.BeginnerEvents show `pull access denied for registry.example.com/web, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed`.BeginnerPulls from Docker Hub randomly fail with `toomanyrequests: You have reached your pull rate limit`.IntermediateA private registry with an internal CA fails with `x509: certificate signed by unknown authority` during image pull.IntermediateA new image works on laptops but on nodes the Pod crash-loops and logs show only `exec /app/server: exec format error`.Intermediate