kubectl get events only for a pod
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Pod events are one of the fastest ways to diagnose Kubernetes startup and scheduling issues. Instead of scanning all namespace events, you can filter by the specific pod name and object kind. With a few targeted commands, you can quickly identify image pull failures, probe errors, or scheduling constraints.
Basic Command to Filter Events by Pod Name
The most common command uses a field selector on involvedObject.name.
This filters events to objects named that pod. Add involvedObject.kind=Pod to avoid matches from other object types with similar names.
For clusters with heavy event volume, this is much faster than fetching all events and grepping locally.
Get Pod Name First
If you only know deployment or labels, resolve pod names first.
Then choose the failing pod and run event query with that exact name.
For single-pod lookup in scripts:
This pattern is useful in CI diagnostics.
Sort Events by Time for Easier Reading
Default event ordering can be hard to follow. Sort by creation timestamp to reconstruct sequence.
Seeing chronological order helps identify whether failures are due to scheduling, image pull, then probe checks, or another chain.
Use kubectl describe pod as a Companion View
describe includes related event snippets and often surfaces the same root cause with less filtering.
Use describe for quick checks, and get events when you need scriptable output or broader event history.
Structured Output for Automation
For automated troubleshooting, request JSON and parse relevant fields.
You can extract reasons and messages with jq.
This is helpful for alert pipelines and incident summaries.
Newer kubectl events Command
Some Kubernetes versions provide kubectl events, which presents event-focused output directly.
If available in your client version, this can be cleaner than get events field selectors. Keep get events knowledge anyway because many environments still rely on it.
Typical Pod Event Reasons and What They Mean
Common event reasons include:
FailedScheduling: insufficient CPU, memory, node selector mismatch, or taint constraints.Failed: container runtime failures.ErrImagePullorImagePullBackOff: image name, registry auth, or network issues.Unhealthy: readiness or liveness probe failures.BackOff: repeated restart failures.
Map event reason to next diagnostic command. For example, ImagePullBackOff should lead to checking image tag and pull secret in deployment spec.
Namespace and Retention Considerations
Events are namespace-scoped, so always pass -n for non-default namespaces. Missing namespace is a common reason for empty results.
Also remember events are ephemeral. Retention can be short depending on cluster settings, so recent failures may disappear from history. For long-term auditing, forward events to logging or observability systems.
Common Pitfalls
One pitfall is filtering only by pod name without involvedObject.kind. This can produce noisy results in edge cases.
Another issue is querying the wrong namespace and assuming no events exist. Always verify namespace and pod name spelling first.
Users also rely only on one command. In practice, combine get events, describe pod, and container logs for complete diagnosis.
Finally, do not assume old events reflect current pod state. Restarted replicas with new names generate new event streams.
Summary
- Use field selectors to retrieve events for one pod quickly.
- Include
involvedObject.kind=Podand correct namespace for precise filtering. - Sort events by timestamp to reconstruct failure sequence.
- Use JSON output for scripting and incident automation.
- Combine pod events with
describeand logs for full troubleshooting coverage.

