How can the resource utilization rate be viewed using kubectl?

To view the resource utilization, you can use the following command:

  1. View the resource usage of all nodes in the cluster.
kubectl top nodes
  1. View the resource utilization rate of a specified node.
kubectl top nodes <node-name>

Replace with the name of the node.

  1. View the resource utilization of all Pods in the cluster.
kubectl top pods
  1. View the resource utilization of all Pods in a specific namespace.
kubectl top pods -n <namespace>

Replace with the name of the namespace.

  1. View the resource usage of a specific Pod.
kubectl top pods <pod-name> -n <namespace>

Replace with the name of the pod, and with the name of the namespace.

These commands will display the usage of CPU and memory, as well as the occupancy rate of each node or Pod.

bannerAds