How do you troubleshoot CrashLoopBackOff, Pending, ImagePullBackOff and OOMKilled pods?
Toolkit
kubectl get pods -o wide, kubectl describe pod (events at the bottom), kubectl logs pod [-c container] [--previous], kubectl get events --sort-by=.lastTimestamp, kubectl top pod/node, kubectl debug (ephemeral containers), kubectl exec.
Pending
The scheduler cannot place the pod. describe shows why: insufficient CPU or memory (requests too large, or the cluster is full and the autoscaler cannot add nodes), node selector, affinity or taint mismatch, an unbound PersistentVolumeClaim (wrong storage class or zone), or a quota exceeded.
ImagePullBackOff / ErrImagePull
Wrong image name or tag, a missing imagePullSecret for a private registry, registry auth or rate limits, the node cannot reach the registry (network, proxy), or wrong architecture (ARM vs AMD64).
CrashLoopBackOff
The container starts and exits repeatedly, with growing backoff. Check kubectl logs --previous and the exit code in describe:
- Exit 1 (application error): bad configuration, missing environment variable or secret, cannot reach the database at startup, failed Flyway migration.
- Exit 137 (SIGKILL): OOMKilled (shown as the last state reason) or killed by a failing liveness probe.
- Exit 143 (SIGTERM): stopped, often by a liveness probe failure.
- Liveness probe too aggressive for startup time: add a startup probe.
OOMKilled
The container exceeded its memory limit. For Java: heap too close to the limit or native memory growth (see the JVM-in-containers question). Raise the limit or reduce MaxRAMPercentage, check for leaks, use Native Memory Tracking.
Running but not receiving traffic
Readiness failing, Service selector labels not matching pod labels (kubectl get endpointslices), wrong targetPort, NetworkPolicy blocking, Ingress path or host mismatch.
Follow-up questions interviewers ask
Try answering each one before you open it.
How do you debug a distroless container with no shell?
Use an ephemeral debug container that shares the target's process namespace: kubectl debug -it orders-7d9f --image=busybox --target=app, then inspect /proc/1/root, network and processes. Or copy the pod with a debug image: kubectl debug orders-7d9f --copy-to=orders-debug --container=app --image=eclipse-temurin:21-jdk.
A pod works locally but fails in the cluster. What do you compare?
Configuration and secrets actually mounted (kubectl exec env, mounted files), DNS names and network reachability to dependencies (NetworkPolicies, security groups), the service account's permissions (workload identity), resource limits (memory, CPU throttling), filesystem permissions (read-only root FS, non-root user), and the image architecture and tag actually deployed.