Pro ยท Lesson 8 of 12

Observability and debugging

Most failures are visible in events, Pod status, and logs before you need another tool.

Sign in to save your place.

Picture it this way

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).

A short order of checks

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

Debugging without a new screenshot tool

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.

Probes show up as events

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.

Where to look

  1. Events
  2. Logs
  3. Debug

Step 1 of 3Events explain why the Pod never started.

Lab: break a Pod on purpose

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

Concept summary

Knowledge check

A Pod is Pending and describe says the persistent volume is not found. Where is the problem?

CrashLoopBackOff and an empty current log. What next?

kubectl top fails on a new kind cluster. What is a fair conclusion?

Official sources

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.