kubectl get pods shows a pod in CrashLoopBackOff with 7 restarts. What does that status actually mean, and what is the single most useful next command?
- The image could not be pulled from the registry. Check imagePullSecrets. Pull problems show as ImagePullBackOff / ErrImagePull; the container never ran, so there is nothing to crash.
- The node is unhealthy and the pod is being moved. Check
kubectl get nodes. Pods are not moved by the kubelet; and the status says the container ran and exited. - The container starts and exits repeatedly; the kubelet waits longer between restarts each time. Run
kubectl logs <pod> --previousto read the crashed instance. The process is exiting on its own; the backoff is the kubelet's, and the previous container's logs hold the exit reason. - The scheduler cannot place the pod. Check resource requests. Unschedulable pods sit in Pending; this pod has been running and crashing.
The container keeps starting and exiting, so run kubectl logs --previous to read the crashed instance.
CrashLoopBackOff is a kubelet state, not an application error: the container exited (any code) and the kubelet is applying an exponential backoff (10 s, 20 s, 40 s… capped at five minutes) before the next start. The evidence lives in the previous container's logs and in the exit code shown by kubectl describe pod.
Treating CrashLoopBackOff as the cause, or deleting the pod to 'see if it comes back'. That destroys the events and the previous logs and reproduces the same failure.