Bird
0
0

What will be the output of the command kubectl get pods -n kube-system?

medium📝 Command Output Q4 of 15
Kubernetes - kubectl Essential Commands
What will be the output of the command kubectl get pods -n kube-system?
ALists all pods in all namespaces
BLists all pods running in the kube-system namespace
CShows detailed information about a single pod
DDeletes all pods in the kube-system namespace
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command components

    kubectl get pods lists pods, and -n kube-system limits the output to the kube-system namespace.

  2. Step 2: Determine the output

    The command lists all pods running in the kube-system namespace, not all namespaces or deleting pods.

  3. Final Answer:

    Lists all pods running in the kube-system namespace -> Option B
  4. Quick Check:

    kubectl get pods -n kube-system = List pods in kube-system [OK]
Quick Trick: Use -n to specify namespace in kubectl commands [OK]
Common Mistakes:
  • Assuming it lists pods in all namespaces
  • Thinking it deletes pods
  • Confusing get with describe

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes