Lesson 5: Peeking inside a Pod (describe & logs)
You created a Pod, but it is stuck or acting strange — now what? Instead of guessing, you learn to read its state. Kubernetes gives you two different "windows" into a Pod, and it matters not to mix them up. The command kubectl describe pod shows the operational picture: the Status, and the chain of
describe is like the Pod's medical chart — what happened to it and who treated it. logs is its personal diary — what it wrote itself.
- Pod Lifecycle
- The series of phases a Pod moves through: Pending (waiting to be scheduled or to pull its image), Running (at least one container is running), then Succeeded (finished fine) or Failed. The status tells where the Pod is at a given moment.
- describe
- The command kubectl describe pod shows a detailed operational description of the Pod: its status, configuration, and chain of Events. It is the "outside view" — what Kubernetes knows and did with the Pod, not the application's output.
- logs
- The command kubectl logs shows the output (stdout/stderr) that the application inside the container printed. It is the "application's own voice" — not what Kubernetes thinks about it.
- Events
- Short records that document what happened to the Pod along the way: assignment to a node (Scheduled), image pull (Pulled), container start (Started), and errors if any. They appear at the bottom of describe output and explain "why" the Pod is in its current state.