DevOpsInterview.Cloud
Kubernetes

Kubernetes Events - The Debug Tool You're Ignoring

2 min read

A pod is crashing or stuck pending and you need to find out why, fast. This question comes up constantly in DevOps and SRE interviews because it separates people who reach for kubectl logs and guess from people who actually know where Kubernetes surfaces its own diagnostics first.

The answer interviewers want

Kubernetes events are effectively your cluster's audit log. They show exactly what happened to a resource: scheduling failures, failed image pulls, hitting resource limits, and similar lifecycle problems. When a pod misbehaves, events are where you look before you do anything else.

In practice: run kubectl get events, sort by timestamp, and scan for Warning or Error entries. If you're chasing a specific issue, filter by namespace so you're not wading through noise from unrelated workloads:

kubectl get events -n <namespace> --sort-by=.metadata.creationTimestamp

The part most people miss: events expire after one hour by default. If you don't pull them early, the evidence is just gone. So the habit to build is check events first, before they disappear, not as a last resort after you've already burned time reading logs. Next time a pod crashes, events will usually hand you the root cause in seconds rather than minutes.

Why interviewers ask this

This is a filter for production instinct versus textbook knowledge. Anyone can say "check the logs," but logs tell you what the application did, not what the cluster tried to do to it. Interviewers want to see that you know Kubernetes exposes its own decision trail, and that you understand the timing constraint that makes acting fast actually matter.

Follow-ups to expect

"What do you do if the events have already expired?" You've lost that window, so you'd fall back to logs, describe output, and controller or scheduler logs if you have access, but you'd also flag that this is why checking events immediately matters.

"What kind of problems show up in events versus logs?" Scheduling failures, image pull errors, and resource limit issues show up in events because they happen before or outside the application process; logs only capture what's happening inside the running container.

"How would you narrow down events in a busy cluster?" Filter by namespace to cut out unrelated noise, then sort by timestamp and scan for Warning or Error severity to find the signal quickly.

The common wrong answer

Most candidates jump straight to kubectl logs or describing a pod and start reasoning from application output, treating events as an afterthought if they mention them at all. That approach works eventually, but it's slower and it ignores the fact that events often explain problems the application itself never even gets a chance to log, like a pod that never got scheduled in the first place. It also ignores the one-hour expiry, so candidates who don't mention checking events early are signaling they haven't actually been burned by losing that data in a real incident.

Prefer it spoken? Watch the 30-second answer on YouTube

More Kubernetes questions