Sign In

Curriculum 13: Debugging & Troubleshooting

Describing Failures

15 min · 25 XP

Reading kubectl describe Output for Failures

The kubectl describe command provides a comprehensive view of a resource's current state, conditions, and recent events. Learning to read its output is one of the most important debugging skills in Kubernetes.

Key Sections in describe Output

kubectl describe pod my-pod

Focus on these sections when troubleshooting:

  • Status: The current phase (Pending, Running, Failed, Succeeded)
  • Conditions: Boolean statuses like PodScheduled, Initialized, ContainersReady, Ready
  • State / Last State: Current and previous container state with exit codes and reasons
  • Events: Recent events attached to this specific resource

Debugging Pending Pods

A pod stuck in Pending has not been scheduled to a node. Look at Conditions and Events:

kubectl describe pod pending-pod

Common causes include:

  • Insufficient resources: 0/3 nodes are available: 3 Insufficient cpu
  • No matching nodes: Taints, tolerations, or nodeSelector mismatches
  • Unbound PVC: persistentvolumeclaim "data" not found

Debugging ImagePullBackOff

The container image could not be pulled. Check the Events section:

kubectl describe pod bad-image-pod
# Events will show:
#   Failed to pull image "myapp:wrong-tag": manifest unknown

Common causes: wrong image name or tag, private registry without imagePullSecrets, network issues.

Debugging CrashLoopBackOff

The container starts but exits immediately. The describe output shows:

kubectl describe pod crashing-pod
# Last State:  Terminated
#   Exit Code: 1
#   Reason:    Error

Pair this with kubectl logs --previous to see what the application printed before crashing.

Common Failure Pattern Summary

StatusWhere to LookTypical Cause
PendingEvents, ConditionsResource limits, scheduling
ImagePullBackOffEventsWrong image, auth, network
CrashLoopBackOffLast State, LogsApp error, bad config
CreateContainerConfigErrorEventsMissing ConfigMap or Secret

Always start with describe to get the high-level picture, then drill into logs and events for details.