Events, describe and kubectl top
Almost every "why is this broken" question is answered by events, and almost everyone reads them the slow way. This creates two Pods that fail differently - one unschedulable, one unpullable - and works through sorting and filtering events, reading describe's own Events section, and using top for the numbers that events never contain.
Observability and Maintenance Guide 43 of 44 Beginner
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 15 min
Events expire. The API server's --event-ttl defaults to one hour, so an event from this morning is simply gone - which is why kubectl get events on a Pod that has been failing all night is often empty while the Pod's status still shows the problem.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when something will not run and you need the reason quickly. This matters because events explain decisions while top reports consumption - they answer completely different questions, and only one of the two expires.
- creating two Pods that fail for two entirely different reasons
- sorting and filtering events, which come back in no useful order by default
- using
describeto get one object's events already gathered into one place - reading
kubectl topfor the thing events never tell you - finding the default event TTL, and why the evidence disappears
Before you start
- A cluster with metrics-server for the
topstep. - The session creates namespace
ckad-evwith a Pod requesting 40 CPUs and 200Gi of memory, a Pod with an image tag that does not exist, and a small Deployment to measure.
-
Two Pods that will not run
-
Events, sorted and filtered
-
describe puts it in one place
-
top, for what events never tell you
-
Events do not last