Troubleshooting Debug
Fast paths for common container and cluster failures. Results appear in the same fence: same-line # comments when short, multiline # blocks below the sample when not. Fences are bash, dockerfile, or yaml as appropriate.
Container starts then exits repeatedly.
kubectl describe pod api-xyz | sed -n '/Events/,$p'
# look for Error/OOMKilled/exit codes
kubectl logs api-xyz --previous
# logs from last crash
Cannot pull image - auth, tag, or network.
kubectl describe pod api-xyz | grep -A5 'Failed to pull'
# ErrImagePull / unauthorized / not found
Namespace events sorted.
kubectl get events --sort-by=.lastTimestamp
# last events first
Ephemeral debug container (if enabled).
kubectl debug -it api-xyz --image=nicolaka/netshoot --target=api
# network tooling alongside app
Local engine container state.
docker inspect -f '{{.State.Status}} {{.State.ExitCode}}' web
# exited 1
Pod stuck Pending - resources/taints/PVC.
kubectl describe pod api-xyz | grep -A20 Events
# FailedScheduling messages
Check if pods are ready for a Service.
kubectl get endpoints api
# IP list empty => no ready pods
Debug Service DNS from a pod.
kubectl run -it --rm net --image=nicolaka/netshoot --restart=Never -- nslookup api
# answers ClusterIP
Connectivity blocked by policy.
# from netshoot: curl fails while policy denies
# kubectl get networkpolicy -A
API access denied.
kubectl auth can-i list pods --as system:serviceaccount:app:api-sa
# no
Node pressure or kubelet down.
kubectl get nodes
# STATUS NotReady
kubectl describe node node-1 | tail -30
# conditions/events
Node eviction from disk pressure.
kubectl describe node node-1 | grep -i pressure
# DiskPressure True
Multi-service local debug.
docker compose ps
docker compose logs --no-color api | tail -50
# exit codes and last logs
Slow builds from large context.
du -sh .
# ensure .dockerignore excludes node_modules/.git
Release failed mid-upgrade.
helm status api -n app
# STATUS: failed
helm history api -n app
# find last deployed revision
Stack versions: Kubernetes 1.36.2 · Docker Engine 29.6.1 · Helm 3 · Compose v2 · containerd via CRI