Bird
0
0

Which command lists all pods in all namespaces using kubectl?

easy📝 Conceptual Q2 of 15
Kubernetes - kubectl Essential Commands
Which command lists all pods in all namespaces using kubectl?
Akubectl get pods --all-namespaces
Bkubectl get pods -n all
Ckubectl list pods --all
Dkubectl get all pods
Step-by-Step Solution
Solution:
  1. Step 1: Identify the flag for all namespaces

    The flag --all-namespaces lists resources across all namespaces.
  2. Step 2: Apply the flag with the correct resource

    Using kubectl get pods --all-namespaces lists all pods in every namespace.
  3. Final Answer:

    kubectl get pods --all-namespaces -> Option A
  4. Quick Check:

    List pods in all namespaces = kubectl get pods --all-namespaces [OK]
Quick Trick: Use --all-namespaces to list resources cluster-wide [OK]
Common Mistakes:
  • Using '-n all' which is invalid
  • Using 'kubectl list' which is not a valid command

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes