Bird
0
0

What will happen if you run kubectl exec -it my-pod -- bash on a Pod that does not have bash installed?

medium📝 Command Output Q5 of 15
Kubernetes - Pods
What will happen if you run kubectl exec -it my-pod -- bash on a Pod that does not have bash installed?
Akubectl exec hangs indefinitely
BYou get a shell prompt with bash
CPod restarts automatically
DError: command not found: bash
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command

    The command tries to open an interactive bash shell inside the Pod.
  2. Step 2: Consider Pod environment

    If bash is not installed, the shell cannot start, so the system returns an error that bash is not found.
  3. Final Answer:

    Error: command not found: bash -> Option D
  4. Quick Check:

    Missing command in Pod = command not found error [OK]
Quick Trick: Pod must have command installed to exec it [OK]
Common Mistakes:
  • Expecting Pod to restart automatically
  • Thinking exec will hang without bash
  • Assuming fallback shell opens

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes