0
0
Kubernetesdevops~20 mins

Viewing Pod details and logs in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Pod Logs Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
Viewing logs of a specific container in a multi-container Pod
You have a Pod named webapp-pod with two containers: frontend and backend. Which command shows logs only from the backend container?
Akubectl logs webapp-pod backend
Bkubectl logs webapp-pod --container=frontend
Ckubectl get logs webapp-pod -c backend
Dkubectl logs webapp-pod -c backend
Attempts:
2 left
💡 Hint
Use the -c or --container flag to specify the container name.
🧠 Conceptual
intermediate
1:30remaining
Understanding Pod description details
Which section in the output of kubectl describe pod mypod shows the current status of each container inside the Pod?
AStatus section
BContainers section
CConditions section
DEvents section
Attempts:
2 left
💡 Hint
Look for container names and their state like Running or Waiting.
Troubleshoot
advanced
2:00remaining
Diagnosing missing logs from a Pod
You run kubectl logs mypod but get the error: Error from server (BadRequest): container "mypod" in pod "mypod" is not available. What is the most likely cause?
AThe Pod has multiple containers and you did not specify which container's logs to show
BThe Pod is not running and logs are unavailable
CThe Pod name is misspelled
Dkubectl logs command requires --all-containers flag
Attempts:
2 left
💡 Hint
Think about how logs are fetched when multiple containers exist.
🔀 Workflow
advanced
2:30remaining
Steps to view real-time logs of a Pod
What is the correct sequence of commands to view real-time logs of a Pod named api-server?
A1,3,4,2
B1,4,2,3
C1,4,3,2
D4,1,2,3
Attempts:
2 left
💡 Hint
First confirm Pod exists, then check details, then stream logs.
Best Practice
expert
2:00remaining
Efficiently viewing logs from all containers in a Pod
You want to view logs from all containers in a Pod named db-pod simultaneously. Which command achieves this?
Akubectl logs db-pod --all-containers=true
Bkubectl logs db-pod -c all
Ckubectl logs db-pod --container=all
Dkubectl logs db-pod
Attempts:
2 left
💡 Hint
Look for a flag that includes logs from every container.