Debugging for Kubernetess
Kubernetes debugging is the process of finding why workloads fail or misbehave, using kubectl describe, logs, events and exec, together with metrics and tracing for observability. Common states to diagnose include Pending, CrashLoopBackOff, ImagePullBackOff and OOMKilled Pods.
Stage: Security and Troubleshooting · Part of the Kubernetes roadmap · Last reviewed 19 November 2026
What to learn in Debugging
- Use kubectl describe and events to find why a Pod is stuck in Pending
- Read container logs, including previous logs after a crash
- Diagnose CrashLoopBackOff, ImagePullBackOff and OOMKilled with the right commands
- Open a shell in a Pod or run an ephemeral debug container
- Collect metrics with Prometheus and view them to spot saturation
Debugging interview questions
A Pod is in CrashLoopBackOff. How do you investigate?
Run kubectl describe pod to check the exit code, reason and events, then kubectl logs with the previous flag to read output from the crashed run. Typical causes are a bad command, missing config or secret, a failing probe or an out of memory kill.
Why might a Pod stay in Pending?
The scheduler cannot place it. Common reasons are insufficient CPU or memory on any node, unsatisfied node selectors or taints, or an unbound PersistentVolumeClaim. The Events section of kubectl describe pod usually states which condition failed.
Where Debugging fits in the Kubernetes roadmap
Debugging belongs to the Security and Troubleshooting stage (advanced level), which takes about 22 hours. Keep it safe and healthy.
Other units in this stage
Back to the full Kubernetes roadmap