Bird
0
0

You want to continuously stream logs from all containers in pod api-server. Which command should you use?

hard📝 Workflow Q9 of 15
Kubernetes - Pods
You want to continuously stream logs from all containers in pod api-server. Which command should you use?
Akubectl logs -f api-server -c all
Bkubectl logs api-server -f
Ckubectl logs api-server --all
Dkubectl logs -f api-server --all-containers=true
Step-by-Step Solution
Solution:
  1. Step 1: Identify flag for all containers

    The flag --all-containers=true streams logs from all containers in the pod.
  2. Step 2: Combine with streaming

    Using -f streams logs live. kubectl logs -f api-server --all-containers=true correctly combines both.
  3. Step 3: Check other options

    kubectl logs api-server -f streams logs but only from one container. kubectl logs api-server --all uses invalid flag. kubectl logs -f api-server -c all incorrectly uses '-c all'.
  4. Final Answer:

    kubectl logs -f api-server --all-containers=true -> Option D
  5. Quick Check:

    Use '--all-containers=true' to stream all containers [OK]
Quick Trick: Add '--all-containers=true' to stream all containers [OK]
Common Mistakes:
  • Using '-c all' which is invalid
  • Missing '--all-containers' flag
  • Wrong flag '--all'

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes