0
0
Kubernetesdevops~20 mins

kubectl describe for details in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kubectl Describe Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What does kubectl describe pod mypod show?
You run kubectl describe pod mypod. What kind of information will you see in the output?
AOnly the pod's IP address and node name.
BA list of all pods in the cluster with their current status.
CDetailed info about the pod including labels, annotations, container statuses, events, and resource usage.
DThe YAML configuration used to create the pod.
Attempts:
2 left
💡 Hint
Think about what 'describe' means: it gives detailed info about a specific resource.
💻 Command Output
intermediate
2:00remaining
What error appears if you describe a non-existent pod?
You run kubectl describe pod unknownpod but the pod does not exist. What is the output?
ATimeout error waiting for pod description
BNo output, command silently succeeds
CSyntax error: invalid pod name
DError from server (NotFound): pods "unknownpod" not found
Attempts:
2 left
💡 Hint
If a resource does not exist, kubectl usually reports a NotFound error.
Configuration
advanced
2:00remaining
Which option shows how to describe all pods in a namespace?
You want to see detailed info for all pods in the namespace dev. Which command will do this?
Akubectl describe all pods dev
Bkubectl describe pods -n dev
Ckubectl get pods -n dev --describe
Dkubectl describe pod dev
Attempts:
2 left
💡 Hint
Use plural resource name and specify namespace with -n.
Troubleshoot
advanced
2:00remaining
Why does kubectl describe pod mypod show no events?
You run kubectl describe pod mypod but the events section is empty. What could be a reason?
ANo recent events have occurred for the pod.
BThe pod is in CrashLoopBackOff state.
Ckubectl describe does not show events for pods.
DThe pod is running on a node that is offline.
Attempts:
2 left
💡 Hint
Events only appear if something happened recently.
Best Practice
expert
2:00remaining
What is the best way to get detailed info about a pod and save it for later?
You want to describe a pod named mypod and save the detailed output to a file for sharing. Which command is best?
Akubectl describe pod mypod | tee pod-details.txt
Bkubectl get pod mypod -o yaml > pod-details.txt
Ckubectl logs mypod > pod-details.txt
Dkubectl describe pod mypod > pod-details.txt
Attempts:
2 left
💡 Hint
You want to see output on screen and save it at the same time.