Debugging Kubernetes
CrashLoopBackOff, ImagePullBackOff, pending pods, kubectl triage flow. Interviewers love a live outage walkthrough.
The mental model
Debugging Kubernetes is not mysterious once you accept one thing: a pod's status tells you which of four stages it is stuck in, and each stage has a different set of possible causes. You are not searching a space of a thousand problems. You are answering four questions in order.
The analogy that sticks: a new employee's first day.
- **Did HR find them a desk?** — scheduling. If not, the pod is
Pending, and the reason is capacity, taints, or unsatisfiable placement rules. - **Did the building let them in?** — image pull. If not,
ImagePullBackOff: wrong name, wrong tag, or no credentials. - **Did they survive the first hour?** — startup. If not,
CrashLoopBackOff: the process exits, so read its logs. - **Are they answering the phone?** — readiness. Running but
0/1 READYmeans the readiness probe fails, so the Service will not send traffic.
The status column is a signpost, not a diagnosis. The diagnosis lives in two places, always: the **Events** at the bottom of kubectl describe pod, and the **previous container's logs** (kubectl logs --previous). If you learn one reflex from this lesson, make it this pair — they resolve the large majority of incidents in under a minute.
The other framing that saves time under pressure: is this one pod, all pods of one workload, or everything on one node? One pod is usually the app. All pods of one workload is usually config or an image. Everything on one node is the node — disk pressure, a dead kubelet, a network plugin problem.
- Deep dive
- Internal architecture
- Real-world use cases
- Best practices
- Common mistakes
- Performance
- Security
- Production troubleshooting
- Advantages & disadvantages
- Alternatives
- Interview expectations
- Interview questions
- Facts to remember
- Cheat sheet
- Quick revision