Kubernetes4 min read· 3 practice problems

Kubernetes troubleshooting by pod status: Pending, ImagePullBackOff, CrashLoopBackOff, Not Ready

Split Kubernetes failures by where the pod stopped — Pending, ImagePullBackOff, CrashLoopBackOff or OOMKilled, Running but not Ready, Services with no endpoints, Ingress 404 and DNS — with the first command for each.

On this page
  1. Short answer: the STATUS column tells you which stage is stuck
  2. Pending — no node to place it on
  3. ImagePullBackOff — the node cannot get the image
  4. CrashLoopBackOff and OOMKilled — it starts, then dies
  5. Running but READY 0/1 · Service does not connect
  6. Ingress 404 · name resolution fails
  7. What not to do
  8. The order to work in
  9. Quick diagnostic checklist

Short answer: the STATUS column tells you which stage is stuck

Kubernetes failures look tangled, but most come apart quickly once you ask where the pod stopped: scheduling → image pull → start → Ready → Service → Ingress and DNS. If an earlier stage is blocked, skip the later ones. The starting point is always the same.

kubectl get pods -n shop -o wide
kubectl describe pod checkout-7d9f8-x2k1p -n shop   # read Events at the bottom first
NAME                   READY   STATUS             RESTARTS      AGE
checkout-7d9f8-x2k1p   0/1     CrashLoopBackOff   6 (40s ago)   9m
checkout-7d9f8-q8w2m   0/1     Pending            0             9m
payment-6f8d9-h2v7c    0/1     ImagePullBackOff   0             3m
orders-5c6b7-mz4tn     0/1     Running            0             12m

Pending — no node to place it on

The FailedScheduling line in Events is the reason. Insufficient cpu or Insufficient memory means no node has room for the requests; untolerated taint or didn't match Pod's node affinity/selector means rules filtered the nodes out; unbound immediate PersistentVolumeClaims means the volume is the problem.

kubectl describe node node-1 | grep -A8 "Allocated resources"

→ Pending: Insufficient cpu · GPU nodes exist but the workload won't schedule

ImagePullBackOff — the node cannot get the image

The text after Failed to pull image in Events picks the branch. not found is the name or tag; 401 Unauthorized or pull access denied is authentication (imagePullSecrets); i/o timeout or x509 is the network or certificates between the node and the registry. → ImagePullBackOff first checks

CrashLoopBackOff and OOMKilled — it starts, then dies

CrashLoopBackOff is not a cause; it only says "the restarts keep repeating". Look at the logs right before the crash and at the termination reason.

kubectl logs checkout-7d9f8-x2k1p -n shop --previous
kubectl describe pod checkout-7d9f8-x2k1p -n shop | grep -A4 "Last State"

Reason: OOMKilled (Exit Code: 137) is the memory limit; Exit Code: 1 is an application error (config, a dependency); Liveness probe failed in Events means the probe killed it. → CrashLoopBackOff first checks · OOMKilled (Exit Code 137)

Running but READY 0/1 · Service does not connect

Running does not mean healthy; it means the container is up. A pod that is not Ready is removed from its Service. A wrong probe path or port is common, as in Readiness probe failed: HTTP probe failed with statuscode: 404. If the pod is Ready and the Service still does not connect, check the endpoints.

kubectl get endpointslices -n shop -l kubernetes.io/service-name=orders
kubectl get svc orders -n shop -o jsonpath='{.spec.selector}'; kubectl get pods -n shop --show-labels

No endpoints means the selector does not match the pod labels. Endpoints present but connections refused means the Service targetPort differs from the container port. → Pod Running but traffic fails

Ingress 404 · name resolution fails

If the Service works from inside the cluster but outside requests get 404, check the Ingress host, path and ingressClassName. If you see no such host or a DNS i/o timeout, it is the DNS path (use a debug pod if the image has no nslookup).

kubectl describe ingress shop -n shop
kubectl exec -it checkout-7d9f8-x2k1p -n shop -- nslookup orders.shop.svc.cluster.local

→ Ingress 404 Not Found · CoreDNS Running but DNS fails

What not to do

  • Deleting or restarting pods before you read the evidence — the previous container's logs disappear, and Events are kept for only one hour by default.
  • Treating the status name as the cause and changing several manifests at once — you will not know which change fixed it.

The order to work in

  1. Use STATUS and READY from kubectl get pods to find the stuck stage
  2. Read the last lines of Events in kubectl describe pod
  3. If it fails to start, check logs --previous and Last State
  4. If it is Running but broken, go Ready → endpoints → Ingress and DNS
  5. After the fix, confirm with kubectl rollout status

To practise this order as a problem, start with CrashLoopBackOff right after a ConfigMap change: same image, pods keep restarting.

Quick diagnostic checklist

  • Use STATUS and READY from kubectl get pods -o wide to find the stuck stage first.
  • Read the last lines of Events in kubectl describe pod before the logs.
  • For Pending, let the FailedScheduling text (Insufficient, taint, affinity, PVC) pick the branch.
  • For ImagePullBackOff, read the text after Failed to pull image (not found, 401, timeout).
  • For CrashLoopBackOff, check kubectl logs --previous and the Reason and Exit Code in Last State.
  • For Running but READY 0/1, look for Readiness probe failed in Events.
  • If the pod is Ready but connections fail, compare the EndpointSlice with the Service selector and targetPort.
  • If only outside traffic gets 404, check the Ingress host, path and ingressClassName; if names do not resolve, check the DNS path.

Practice with this guide

Reviewed problems about the same failure. Write the cause, recovery, and prevention yourself, then compare with the model answer.

Read next