Bird
0
0

You run kubectl logs mypod -c and get an error. What is the likely cause?

medium📝 Troubleshoot Q6 of 15
Kubernetes - Pods
You run kubectl logs mypod -c and get an error. What is the likely cause?
AIncorrect namespace specified
BPod 'mypod' does not exist
CMissing container name after '-c' flag
DLogs command does not support '-c' flag
Step-by-Step Solution
Solution:
  1. Step 1: Understand '-c' flag usage

    The '-c' flag requires a container name after it to specify which container's logs to show.
  2. Step 2: Analyze error cause

    Omitting the container name causes a syntax error. Other options are unrelated to this specific error.
  3. Final Answer:

    Missing container name after '-c' flag -> Option C
  4. Quick Check:

    '-c' needs container name [OK]
Quick Trick: Always provide container name after '-c' [OK]
Common Mistakes:
  • Forgetting container name after '-c'
  • Assuming pod doesn't exist
  • Thinking '-c' is unsupported

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes