kubectl get pods -A --field-selector=status.phase=PendingKubernetes Pod Debugging Cheat Sheet
Troubleshoot Pending, CrashLoopBackOff, image pull, readiness, liveness, and init container problems.
Pending and Unschedulable Pods
kubectl describe pod <pod> -n <namespace>kubectl get pvc -Akubectl describe pvc <claim> -n <namespace>kubectl describe node <node> | sed -n '/Taints:/,/Unschedulable:/p'View pod node selectors and affinity
Inspect scheduling constraints from raw YAML.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.nodeSelector}{"
"}{.spec.affinity}{"
"}'CrashLoopBackOff and Image Pull Errors
Find CrashLoopBackOff pods
List pods that are restarting and failing to stay up.
kubectl get pods -A | grep CrashLoopBackOffRead logs from the previous failed container
Very useful when a restart wipes current state.
kubectl logs <pod> -n <namespace> -c <container> --previousDescribe image pull failures
Inspect ErrImagePull and ImagePullBackOff reasons.
kubectl describe pod <pod> -n <namespace> | sed -n '/Events:/,$p'Inspect image pull secrets referenced by a pod
Verify that imagePullSecrets are wired correctly.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.imagePullSecrets[*].name}{"
"}'Describe docker registry secret
Check secret type and metadata for image pulls.
kubectl describe secret <secret> -n <namespace>Show waiting reason for first container
Compact way to inspect wait state reasons.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.status.containerStatuses[0].state.waiting.reason}{"
"}'Readiness, Liveness, and Startup Probes
Inspect configured probes
View readiness, liveness, and startup probe definitions.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].readinessProbe}{"
"}{.spec.containers[*].livenessProbe}{"
"}{.spec.containers[*].startupProbe}{"
"}'See probe failure events
Describe a pod and inspect event messages for failing probes.
kubectl describe pod <pod> -n <namespace> | grep -A5 -i probeRun the probe command manually
Validate probe behavior inside the container context.
kubectl exec -it <pod> -n <namespace> -c <container> -- <probe-command>Port-forward and test HTTP probe locally
Verify whether the probe endpoint behaves as expected.
kubectl port-forward pod/<pod> -n <namespace> 8080:<container-port>Call a probe endpoint after port-forward
Use curl locally against the forwarded health endpoint.
curl -i http://127.0.0.1:8080/healthzInit Container Debugging
Inspect init container statuses
See waiting, terminated, and exit details for init containers.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.status.initContainerStatuses}{"
"}'Read logs from an init container
Inspect the failing setup step before app containers start.
kubectl logs <pod> -n <namespace> -c <init-container>Describe init container failure
Read events and termination details from the pod description.
kubectl describe pod <pod> -n <namespace>Copy a pod and override its command
Use kubectl debug to clone a pod with a safer command for inspection.
kubectl debug <pod> -n <namespace> --copy-to=<pod>-copy --set-image='*=busybox:1.36' -itResources and OOMKilled
Check resource usage for a pod
Compare live usage against requests and limits.
kubectl top pod <pod> -n <namespace>Show pod resource requests and limits
Inspect CPU and memory resource settings quickly.
kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].resources}{"
"}'kubectl get pod <pod> -n <namespace> -o jsonpath='{.status.containerStatuses[0].lastState.terminated.reason}{"
"}'kubectl get pod <pod> -n <namespace> -o jsonpath='{.status.containerStatuses[0].lastState.terminated.exitCode}{"
"}'