Question 8
Domain 5: Observability, Troubleshooting, and MaintenanceWhich kubectl command is used to view CPU and memory utilization for cluster nodes when metrics-server is running?
Correct answer: A
Explanation
`kubectl top nodes` is the command for viewing node resource usage because the `top` subcommand reports live metrics from metrics-server. It shows CPU and memory utilization for cluster nodes, matching the question’s request.
Why each option is right or wrong
A. kubectl top nodes
The `kubectl top` subcommand is the metrics API client that reads live resource data from metrics-server, and the node-level form is `kubectl top nodes`. In Kubernetes, this returns current CPU and memory usage for each node, whereas `kubectl top pod` is for pods and `kubectl describe node` does not provide the same live utilization output.
B. kubectl get nodes --metrics
C. kubectl describe nodes usage
D. kubectl top pods --all-namespaces