0
0
Kubernetesdevops~20 mins

Event inspection for diagnostics in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Event Inspection Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
What is the output of this command?
You run the command kubectl get events --field-selector involvedObject.kind=Pod,involvedObject.name=myapp-pod. What does this command show?
Kubernetes
kubectl get events --field-selector involvedObject.kind=Pod,involvedObject.name=myapp-pod
AAn error message saying the field-selector is invalid.
BA list of all events in the cluster, including nodes, services, and pods.
CA list of events related only to the Pod named 'myapp-pod', showing recent warnings and normal messages.
DNo output because the command filters out all events.
Attempts:
2 left
💡 Hint
Field selectors filter events by object kind and name.
Troubleshoot
intermediate
1:30remaining
Why does this event inspection command return no events?
You run kubectl get events --namespace=production --field-selector reason=FailedScheduling but get no events. What is the most likely reason?
Kubernetes
kubectl get events --namespace=production --field-selector reason=FailedScheduling
AThere are no scheduling failures in the 'production' namespace currently.
BThe 'reason' field selector is not supported by kubectl.
CYou must add <code>--all-namespaces</code> to see events across namespaces.
DThe command syntax is incorrect; 'reason' should be 'type'.
Attempts:
2 left
💡 Hint
Field selectors only show matching events if they exist.
Configuration
advanced
2:00remaining
How to configure event retention duration in Kubernetes?
You want to increase how long Kubernetes keeps events before deleting them. Which configuration change achieves this?
AChange the <code>kube-controller-manager</code> config to increase event storage size.
BModify the pod spec to include <code>eventRetention: 48h</code> under metadata.
CAdd an annotation <code>event.kubernetes.io/ttl=48h</code> to each event manually.
DSet the <code>--event-ttl</code> flag on the kube-apiserver to a longer duration like '48h'.
Attempts:
2 left
💡 Hint
Event TTL is controlled by the API server flag.
🔀 Workflow
advanced
2:30remaining
What is the correct workflow to diagnose a pod crash using events?
You notice a pod is crashing repeatedly. Which sequence of commands helps diagnose the issue using events?
A1, 4, 3, 2
B4, 1, 2, 3
C4, 2, 1, 3
D2, 4, 1, 3
Attempts:
2 left
💡 Hint
Start by listing pods, then describe, then check events and logs.
Best Practice
expert
3:00remaining
Which practice best improves event inspection for long-term diagnostics?
You want to keep Kubernetes events for weeks to analyze intermittent issues. What is the best approach?
AIntegrate Kubernetes events with an external logging system like Elasticsearch or Loki.
BManually export events daily using <code>kubectl get events</code> and save to files.
CIncrease the <code>--event-ttl</code> flag on kube-apiserver to several weeks.
DAnnotate each event with a timestamp to prevent deletion.
Attempts:
2 left
💡 Hint
Kubernetes events are ephemeral; external storage is recommended.