Bird
0
0

How would you correctly run the command env inside a Pod named api-server using kubectl exec?

easy📝 Syntax Q3 of 15
Kubernetes - Pods
How would you correctly run the command env inside a Pod named api-server using kubectl exec?
Akubectl exec env -- api-server
Bkubectl exec --api-server env
Ckubectl exec api-server -- env
Dkubectl exec api-server env
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct syntax

    The correct syntax is kubectl exec [pod-name] -- [command].
  2. Step 2: Apply to example

    For Pod api-server and command env, it becomes kubectl exec api-server -- env.
  3. Final Answer:

    kubectl exec api-server -- env -> Option C
  4. Quick Check:

    Is the Pod name before the --? Yes. [OK]
Quick Trick: Pod name before --, command after [OK]
Common Mistakes:
  • Placing command before Pod name
  • Omitting the -- separator

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes