Challenge - 5 Problems
Pod Logs Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2: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?Attempts:
2 left
💡 Hint
Use the
-c or --container flag to specify the container name.✗ Incorrect
The
kubectl logs command with -c backend fetches logs from the backend container only. Option D fetches frontend logs, A is invalid syntax, and D uses a wrong command.🧠 Conceptual
intermediate1: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?Attempts:
2 left
💡 Hint
Look for container names and their state like Running or Waiting.
✗ Incorrect
The Containers section lists each container's current state, restart count, and readiness. Events show recent actions, Conditions show Pod-level health, and Status is a summary.
❓ Troubleshoot
advanced2: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?Attempts:
2 left
💡 Hint
Think about how logs are fetched when multiple containers exist.
✗ Incorrect
When a Pod has multiple containers, you must specify the container name with
-c. Otherwise, kubectl tries to find a container named same as the Pod, which fails.🔀 Workflow
advanced2: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?Attempts:
2 left
💡 Hint
First confirm Pod exists, then check details, then stream logs.
✗ Incorrect
You first list pods (1), then get details of the specific Pod (3), then stream logs with -f (2). Option 4 is redundant but acceptable after 1 to confirm Pod name.
✅ Best Practice
expert2: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?Attempts:
2 left
💡 Hint
Look for a flag that includes logs from every container.
✗ Incorrect
The
--all-containers=true flag fetches logs from all containers in the Pod. Options B and C use invalid container names, and D only shows logs from the first container by default.