KCNA Cloud Native Observability Practice Question
A developer wants to view the logs of a specific container named 'sidecar' in a pod called 'web-app'. Which command should they use?
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
✓
kubectl logs web-app -c sidecar
The -c flag specifies the container name when a pod has multiple containers.
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 sidecar --pod web-app
Why it's wrong here
There is no --pod flag; the pod name comes first.
- ✗
kubectl logs -c sidecar web-app
Why it's wrong here
The order of arguments is kubectl logs [pod] [-c container].
- ✗
kubectl logs sidecar web-app
Why it's wrong here
This would try to get logs from a pod named 'sidecar' and a container named 'web-app'.
- ✓
kubectl logs web-app -c sidecar
Why this is correct
Correct. -c specifies the container.
Go deeper
Related to this question
About these practice questions
This KCNA question is part of Courseiva's 833-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 KCNA 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 KCNA exam.