Bird
0
0

Which kubectl command lists CPU and memory usage for pods across all namespaces?

easy📝 Syntax Q3 of 15
Kubernetes - Monitoring and Logging
Which kubectl command lists CPU and memory usage for pods across all namespaces?
Akubectl describe pods --all-namespaces
Bkubectl get pods --all-namespaces -o wide
Ckubectl top pods --all-namespaces
Dkubectl logs pods --all-namespaces
Step-by-Step Solution
Solution:
  1. Step 1: Identify command to show resource usage

    The kubectl top command displays resource metrics like CPU and memory.
  2. Step 2: Include all namespaces

    Using --all-namespaces shows pods across all namespaces.
  3. Final Answer:

    kubectl top pods --all-namespaces -> Option C
  4. Quick Check:

    Command shows CPU and memory usage for all pods [OK]
Quick Trick: Use 'kubectl top pods --all-namespaces' for full cluster metrics [OK]
Common Mistakes:
  • Using 'kubectl get pods' which shows pod info but not resource usage
  • Using 'kubectl describe pods' which gives detailed pod info but no live metrics
  • Using 'kubectl logs' which shows logs, not resource usage

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes