When a pod does not start, the displayed status does not give the cause: each status hides several. There is no need to know every cause by heart: you need a repeatable method that goes down from the most global (cluster, node) to the most precise (pod, container, image).
Three statuses come up in application incidents: CrashLoopBackOff, the
Pending Pod and ImagePullBackOff.
Each one points to a different layer: respectively the application,
the scheduling, and the registry access. This page teaches you to recognize
which one you are looking at, then to open the right guide.
What you will learn
- Run the three commands that give the context of any pod incident
- Tell
CrashLoopBackOff,PendingandImagePullBackOffapart by the layer at fault - Match each error with its first diagnostic step
- Pick the diagnostic guide that fits the observed error
Diagnose with 3 commands
Whatever error is displayed, these three commands give you the initial context:
# 1. Pod state and latest eventskubectl describe pod <pod-name> -n <namespace>
# 2. Logs of the failing container (or of the previous container if it crashed)kubectl logs <pod-name> -n <namespace> --previous
# 3. Namespace events sorted by timestampkubectl get events -n <namespace> --sort-by='.lastTimestamp'Read the Events: field of describe and the output of logs first: they
give the cause, or at least the layer to explore next.
What each error means
The status shown by kubectl get pods points to a precise layer: the application
for CrashLoopBackOff, scheduling for Pending, registry access for
ImagePullBackOff. Find in the table the row that matches what you see: the
second column says what the error means, the third gives the command or the
check to run first.
| Error | Means | First reflex |
|---|---|---|
CrashLoopBackOff | The container starts then stops, and Kubernetes restarts it in a loop with an increasing delay | kubectl logs --previous |
Pending | The scheduler finds no compatible node | kubectl describe pod → Events |
ImagePullBackOff / ErrImagePull | Unable to download the image | Check the name, the tag and the credentials |
Which guide should you open for which error?
This page works as a switchboard: it qualifies the incident, then sends you to the guide that covers the layer at fault. The diagnostic method recommended at the top of the page, whose four levels (cluster, node, pod, network) serve as a common thread, remains the prerequisite.
When the pod starts then restarts in a loop, the guide on
CrashLoopBackOff
explains the exponential backoff and goes through the six frequent causes
with a four-step method. When it stays stuck without ever starting,
the guide on the Pending Pod
reviews insufficient resources, taints, affinity and the unbound PVC. When
the image itself does not download, the guide on
ImagePullBackOff
covers the unreachable registry, the missing tag and the missing
imagePullSecret.
Key takeaways
- Do not diagnose blindly:
kubectl describeandkubectl logs --previousare the first two readings to take - CrashLoopBackOff = a problem in the container itself (config, permissions, missing dependency)
- Pod Pending = a scheduling problem (resources, taints, affinity, PVC)
- ImagePullBackOff = an image access problem (name, tag, credentials, network)
- Exponential backoff spaces out the restarts of a crashing container more and more: Kubernetes waits longer between two attempts
Knowledge check
Check that you have the essentials of this guide. The questions cover only what was just explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Diagnose a Kubernetes CrashLoopBackOff
A new full quiz with random questions
Work again only on the questions you missed