Skip to content
Français
Sync not enabled: your progress stays in this browser My learning
Select theme
Français

Diagnose Kubernetes Application Incidents

By updated

Improve this page

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, Pending and ImagePullBackOff apart 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:

Terminal window
# 1. Pod state and latest events
kubectl 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 timestamp
kubectl 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.

ErrorMeansFirst reflex
CrashLoopBackOffThe container starts then stops, and Kubernetes restarts it in a loop with an increasing delaykubectl logs --previous
PendingThe scheduler finds no compatible nodekubectl describe pod → Events
ImagePullBackOff / ErrImagePullUnable to download the imageCheck 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 describe and kubectl logs --previous are 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

6 questions
6 min
70% to pass

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