kubectl version --shortKubernetes Debugging Cheat Sheet
Core kubectl troubleshooting commands for pods, deployments, services, events, logs, exec sessions, and ephemeral debugging.
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
Cluster Triage
bashANYkubectlversiontriage
bash
bashANYclustertriage
bash
kubectl cluster-infobashANYnodestriage
bash
kubectl get nodesbashANYnodestriage
bash
kubectl get nodes -o widebashANYtriageresources
bash
kubectl get all -AbashANYapitriage
bash
kubectl api-resourcesbashANYclusterdiagnostics
bash
kubectl cluster-info dumpPods and Workloads
bashANYpodstriage
bash
kubectl get pods -AbashANYpodsplacement
bash
kubectl get pods -A -o widebashANYpodsyaml
bash
kubectl get pod <pod> -n <namespace> -o yamlbashANYpodsdescribe
bash
kubectl describe pod <pod> -n <namespace>bashANYdeploymentsrollout
bash
kubectl get deployments -AbashANYdeploymentdescribe
bash
kubectl describe deployment <name> -n <namespace>bashANYdeploymentrollout
bash
kubectl rollout status deployment/<name> -n <namespace>bashANYreplicasetrollout
bash
kubectl get rs -n <namespace>bashANYstatefulsetworkloads
bash
kubectl get statefulsets -AbashANYjobsbatch
bash
kubectl describe job <name> -n <namespace>Events and Conditions
bashANYeventswarnings
bash
kubectl get events -n <namespace>bashANYeventstimeline
bash
kubectl get events -n <namespace> --sort-by=.metadata.creationTimestampbashANYeventscluster
bash
kubectl get events -A --sort-by=.metadata.creationTimestampbashANYwaitready
bash
kubectl wait --for=condition=Ready pod/<pod> -n <namespace> --timeout=60sbashANYpodsconditions
bash
kubectl get pods -n <namespace> -o custom-columns=NAME:.metadata.name,PHASE:.status.phase,REASON:.status.containerStatuses[0].state.waiting.reasonLogs, Exec, and Ephemeral Debugging
bashANYlogspods
bash
kubectl logs <pod> -n <namespace>bashANYlogscontainers
bash
kubectl logs <pod> -n <namespace> -c <container>bashANYlogsstreaming
bash
kubectl logs -f <pod> -n <namespace>bashANYlogscrashloop
bash
kubectl logs <pod> -n <namespace> -pbashANYlogslabels
bash
kubectl logs -n <namespace> -l app=<label> --all-containers=true --prefixbashANYexecshell
bash
kubectl exec -it <pod> -n <namespace> -- /bin/shbashANYexecenv
bash
kubectl exec <pod> -n <namespace> -- envbashANYcopyfiles
bash
kubectl cp <namespace>/<pod>:/path/in/pod ./local-filebashANYdebugephemeral-containers
bash
kubectl debug -it <pod> -n <namespace> --image=busybox:1.36 --target=<container>Create a copy of a pod for debugging
Duplicate a pod and add a debug container or different command.
bashANYdebugcopy-pod
bash
kubectl debug <pod> -n <namespace> --copy-to=<pod>-debug --container=debugger --image=busybox:1.36 -itbashANYport-forwardpods
bash
kubectl port-forward pod/<pod> -n <namespace> 8080:80JSONPath and Useful One-Liners
bashANYjsonpathrestarts
bash
kubectl get pods -A -o custom-columns=NS:.metadata.namespace,POD:.metadata.name,RESTARTS:.status.containerStatuses[*].restartCountbashANYjsonpathplacement
bash
kubectl get pods -A -o custom-columns=NS:.metadata.namespace,POD:.metadata.name,NODE:.spec.nodeNamebashANYjsonpathimages
bash
kubectl get pods -A -o jsonpath='{..image}' | tr -s '[[:space:]]' '
' | sort | uniq -cbashANYpodsnot-ready
bash
kubectl get pods -A --field-selector=status.phase!=RunningbashANYmetricsresources
bash
kubectl top pods -AbashANYmetricsnodes
bash
kubectl top nodesMore in Kubernetes Debugging
Kubernetes Logs and Events Cheat Sheet
Find pod logs, previous container logs, event timelines, kube-system logs, and cluster incident evidence quickly.
Kubernetes Node Debugging Cheat Sheet
Diagnose node readiness, kubelet issues, pressure conditions, cordon/drain, and node-level debugging with kubectl debug.
Kubernetes Network Debugging Cheat Sheet
Debug Services, DNS, Ingress, network policies, connectivity, endpoints, and port-forwarding issues.
Kubernetes Pod Debugging Cheat Sheet
Troubleshoot Pending, CrashLoopBackOff, image pull, readiness, liveness, and init container problems.