Bird
0
0

Which flag is used with kubectl exec to specify the container when a Pod has multiple containers?

easy📝 Conceptual Q2 of 15
Kubernetes - Pods
Which flag is used with kubectl exec to specify the container when a Pod has multiple containers?
A-c
B--pod
C--container
D--select
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct flag for container selection

    When a Pod has multiple containers, the -c flag is used to specify which container to run the command in.
  2. Step 2: Verify other options

    Flags like --pod or --select do not exist for this purpose; --container is not a valid flag.
  3. Final Answer:

    -c -> Option A
  4. Quick Check:

    Container selection flag = -c [OK]
Quick Trick: Use -c to pick container in multi-container Pod [OK]
Common Mistakes:
  • Using --container instead of -c
  • Trying to use --pod to select container
  • Omitting container flag in multi-container Pod

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes