Pro ยท Lesson 8 of 12
Most failures are visible in events, Pod status, and logs before you need another tool.
Sign in to save your place.
The boat did not leave. First read the note on the dock (the event), then ask the boat what it printed (the logs), then look inside if it is still there (debug).
kubectl get pods shows a status word: Pending, CrashLoopBackOff, Error, Running, Completed. The word is not the diagnosis. kubectl describe pod puts events at the bottom: image pull errors, failed mounts, probe failures, and scheduling complaints.
kubectl logs prints what the process wrote. --previous is the last crashed container. If the process never started, the log is empty and the event is the useful part.
| Status | Often means | Next command |
|---|---|---|
| Pending | No node, or a volume is not ready | describe the Pod |
| ImagePullBackOff | The image name, tag, or pull secret is wrong | describe, then check the image |
| CrashLoopBackOff | The process starts and exits | logs --previous |
kubectl exec works when the container is running and includes a shell. Many minimal images do not. kubectl debug can attach an ephemeral container. That feature depends on the cluster version and on permission to create ephemeral containers. If the command is rejected, read the error. Do not invent a node SSH step as the default.
kubectl top needs metrics-server or an equivalent. A local kind cluster often does not have it. Missing metrics are not proof the Pod is idle.
A readiness probe that never passes leaves the Pod out of the Service. A liveness probe that is too aggressive restarts a slow process. Describe the Pod and read the probe events before you change the image.
Step 1 of 3Events explain why the Pod never started.
Step 2 of 3Logs explain what a started process printed.
Step 3 of 3exec or an ephemeral container is for a process that is still there.
Use an image tag that does not exist. Describe the Pod and find the pull error. Then delete the Pod.
kubectl run bad --image=nginx:this-tag-does-not-exist --restart=Never
kubectl describe pod bad | tail -n 20
kubectl delete pod bad --wait=false
Checked against the linked documentation in October 2026. A later release can move a flag, a price, or a supported pair. Use the page for the version you installed.