Bird
0
0

How do you correctly start an interactive bash shell inside the container named web in the pod frontend?

easy📝 Syntax Q3 of 15
Kubernetes - kubectl Essential Commands
How do you correctly start an interactive bash shell inside the container named web in the pod frontend?
Akubectl exec -it frontend -c web -- /bin/bash
Bkubectl exec frontend /bin/bash -c web
Ckubectl exec -c web frontend /bin/bash -i
Dkubectl exec frontend -it /bin/bash -c web
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct syntax

    The correct syntax for running an interactive shell is kubectl exec -it [pod] -c [container] -- [command].
  2. Step 2: Match options

    kubectl exec -it frontend -c web -- /bin/bash matches this syntax exactly.
  3. Final Answer:

    kubectl exec -it frontend -c web -- /bin/bash -> Option A
  4. Quick Check:

    Correct flags and order [OK]
Quick Trick: Use -it and -- before command for interactive shell [OK]
Common Mistakes:
  • Placing container name after the command
  • Omitting the -- separator
  • Incorrect flag order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes