Displaying node resource usage
It is handy to know what resources are consumed by nodes. To display the resources used by nodes, run the following command:
$ kubectl top nodes
We get the following list of nodes using the preceding command:
The previous command shows node metrics such as CPU cores, memory (in bytes), and CPU and memory percentage usage.
Also, by using $ watch kubectl top nodes
, you can watch and monitor nodes in real time when, for example, load testing your application or doing other node operations.
Note
The watch
command might not be present in your computer, you might need to install it. The watch
command will run the specified command and refresh the screen every few seconds.