describe shows what Kubernetes did to a Pod. It cannot tell you what the program inside said. For that, read the logs.
kubectl logs
Everything a container writes to its output is kept as its logs:
text
learner@shallows:~$ kubectl logs market-api
2025-03-10T09:00:29Z INFO market-api starting
2025-03-10T09:00:30Z ERROR MONSTER_DB_URL is not set
panic: cannot connect to MONSTER_DB_URLA program that crashes almost always says why in its last lines.
Useful options
| Option | Shows |
|---|---|
--tail=20 | Only the newest 20 lines |
--previous | The output of the container that ran before the last restart |
-f | Keeps printing as new lines arrive (Ctrl+C stops it) |
--previous matters for crash loops. The current container may have only just started and have written nothing yet. The one that died has the error.
Which tool when
What did Kubernetes do to the Pod? Pull, start, restart, failkubectl describe pod
What did the program do? Its own messages and errorskubectl logs
A Pod in ImagePullBackOff has no logs: the container never started. A Pod in CrashLoopBackOff has logs, and they are the first thing to read.