CKA Troubleshooting Practice Question
Which command shows all events in the cluster, sorted by timestamp?
⚠ Common exam trap
Candidates often forget that `kubectl get events` is namespace-scoped by default and will only return events for the active namespace unless `-A` or `--all-namespaces` is explicitly provided.
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
To retrieve all events across the entire cluster, the `-A` or `--all-namespaces` flag must be used. The correct command is `kubectl get events -A --sort-by='.metadata.creationTimestamp'`. The `--sort-by` flag uses a JSONPath expression to order the output based on the creation timestamp of the events.
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 logs --all-namespaces [wrong]
Why it's wrong here
This shows pod logs, not events.
- ✗
kubectl top events [wrong]
Why it's wrong here
kubectl top events is not a valid command.
- ✗
kubectl describe events [wrong]
Why it's wrong here
kubectl describe events is not a valid command; use kubectl get events.
- ✗
kubectl get events -A --sort-by='.metadata.creationTimestamp'
Why it's wrong here
This command retrieves events sorted by creation timestamp.
Go deeper
Related to this question
About these practice questions
Courseiva writes every CKA question from scratch — 302 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 CKA 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 CKA exam.