Archive · Kubernetes

Troubleshooting Pods: A Short Checklist

From Pending to CrashLoopBackOff: the commands to run, in order.

1 min read

  • Kubernetes 1.23
  • kubectl 1.23

Start with the status, then the events, then the logs.

kubectl get pods -o wide
kubectl describe pod web-6d4f   # read the Events at the bottom
kubectl logs web-6d4f --previous
kubectl get events --sort-by=.lastTimestamp
Status Usual cause
Pending Not enough CPU or memory on any node, unbound PVC, or node selector mismatch
ImagePullBackOff Wrong image name or tag, or missing registry credentials
CrashLoopBackOff Application exits: read the previous logs and the exit code
OOMKilled Memory limit too low or a leak
Running but not Ready Readiness probe failing, check the path and port

If the pod has no shell, attach a debugging container (beta in 1.23):

kubectl debug -it web-6d4f --image=busybox:1.34 --target=web

For service problems, check kubectl get endpoints and test from a throwaway pod. Most outages end up being a typo in a label, a port or an image tag.