How can the resource utilization rate be viewed using kubectl?
To view the resource utilization, you can use the following command:
- View the resource usage of all nodes in the cluster.
kubectl top nodes
- View the resource utilization rate of a specified node.
kubectl top nodes <node-name>
Replace
- View the resource utilization of all Pods in the cluster.
kubectl top pods
- View the resource utilization of all Pods in a specific namespace.
kubectl top pods -n <namespace>
Replace
- View the resource usage of a specific Pod.
kubectl top pods <pod-name> -n <namespace>
Replace
These commands will display the usage of CPU and memory, as well as the occupancy rate of each node or Pod.