Courseiva
Cloud Native ObservabilitymediumMultiple ChoiceObjective-mapped

KCNA Cloud Native Observability Practice Question

Which command retrieves logs from a specific container named 'sidecar' in a multi-container pod?

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 pod-name -c sidecar

The -c flag specifies the container name.

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 pod-name sidecar

    Why it's wrong here

    This is incorrect; container name must follow -c flag.

  • kubectl logs pod-name --container sidecar

    Why it's wrong here

    This is also valid but less common; however -c is the flag.

  • kubectl logs pod-name -c sidecar

    Why this is correct

    Correct syntax for specifying a container.

  • kubectl logs sidecar pod-name

    Why it's wrong here

    Order is wrong; pod name comes first.

About these practice questions

Courseiva writes every KCNA question from scratch — 833 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on KCNA

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. What does the 'kubectl logs' command retrieve?

easy
  • A.Audit logs
  • B.Cluster events
  • C.Container logs
  • D.Node logs

Why C: kubectl logs fetches the standard output and standard error logs from a container in a pod.

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.