CKAD Application Observability and Maintenance Practice Question
You need to get a list of all events in the cluster sorted by timestamp. Which command should you use?
⚠ Common exam trap
It's easy for candidates to confuse `kubectl get events` (which lists events) with `kubectl describe events` (which shows details but no sorting), or they assume `kubectl top` or `kubectl logs` have event-related subcommands, leading them to pick a syntactically plausible but incorrect option.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
kubectl get events --sort-by=.metadata.creationTimestamp
`kubectl get events --sort-by=.metadata.creationTimestamp` retrieves all cluster events and sorts them by the creation timestamp field in the event object's metadata. This is the standard Kubernetes approach for ordering events chronologically, as events are stored in etcd and can be sorted client-side using JSONPath expressions against the resource's metadata.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl top events
Why it's wrong here
kubectl top is a metrics command that queries the Metrics API to report real-time CPU and memory consumption, and it is strictly limited to the 'node' and 'pod' subresources. There is no 'top events' subcommand, so running this command results in a CLI error and produces no event data at all. It cannot possibly satisfy the requirement of listing cluster events sorted by creation timestamp.
- ✗
kubectl describe events
Why it's wrong here
The describe verb is intended for deep, human-readable inspection of a specific resource, not for producing a list oriented by time. Even if you run 'kubectl describe events' (or the singular for a single event), the output is a verbose, unstructured summary that aggregates event messages around the objects they refer to, with no sort order. To get an individual event you would also need to know its exact name, which still does not provide a cluster-wide chronological listing.
- ✓
kubectl get events --sort-by=.metadata.creationTimestamp
Why this is correct
This is the correct command because kubectl get is the list-oriented verb for Kubernetes resources, and its --sort-by flag accepts a JSONPath expression to order the returned objects. By specifying .metadata.creationTimestamp, all events are sorted chronologically from oldest to newest based on when they were first recorded. The command prints the events in a clean tabular format, making it easy to see the sequence of cluster activity.
- ✗
kubectl logs --events
Why it's wrong here
The kubectl logs command is exclusively for extracting container stdout/stderr logs from a specific pod and its containers, and it supports flags like --since, --tail, --follow, and --previous, but --events is not one of them. Passing an unrecognized flag immediately triggers a kubectl parsing error, so no output is generated. Even if such a flag existed, container logs are unrelated to the cluster event stream and would not provide event data.
Go deeper
Related to this question
About these practice questions
This CKAD question is part of Courseiva's 826-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the CKAD exam.