Bird
0
0

You run this command but get an error:

medium📝 Troubleshoot Q14 of 15
Kubernetes - Pods
You run this command but get an error:
kubectl exec mypod ls /data

What is the most likely cause?
AMissing <code>--</code> before the command
BPod <code>mypod</code> does not exist
CThe <code>ls</code> command is invalid
DYou need to specify the container with <code>-c</code>
Step-by-Step Solution
Solution:
  1. Step 1: Check command syntax

    The command is missing the -- separator between Pod name and command.
  2. Step 2: Understand effect of missing --

    Without --, kubectl treats ls as a Pod or option, causing an error.
  3. Final Answer:

    Missing -- before the command -> Option A
  4. Quick Check:

    Always use -- before command [OK]
Quick Trick: Always put -- before command to avoid errors [OK]
Common Mistakes:
  • Forgetting the -- separator
  • Assuming container must be specified when only one exists
  • Thinking command is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes