Debugging a Production CrashLoopBackOff
Scenario Prompt:
“A mission-critical deployment rollout was triggered 10 minutes ago. Several pods in the production namespace are stuck in CrashLoopBackOff. The old pods are still taking traffic, but the rollout cannot make progress. Walk me through how you diagnose and fix this.”
Substantive Technical Concepts to Hit:
Container Exit Codes
Check exit code 137 (SIGKILL / Out of Memory) vs exit code 1 (application crash or missing environment variable/config).
Pod Events & Termination Message
Inspect kubectl describe pod to review the Last State, Termination Reason, and the kubelet event stream.
Previous Container Logs
Run kubectl logs --previous to capture stderr output from the failed container instance before it restarted.
ConfigMap & Secret Mounts
Verify that required ConfigMaps, Secrets, or downward API volume projections exist and are properly mounted in the pod spec.
- Are we seeing exit code 137 (OOMKilled) or an application startup failure with exit code 1?
- Is the issue localized to specific worker nodes or spanning the entire cluster fleet?
- Do we have an automated rollback strategy, or should we halt the deployment while investigating?