Monitor Pods And Nodes in Kubernetes with Kubectl Top

This blog post will show you how to monitor Kubernetes pods and nodes with Kubectl command-line and get a quick understanding of the cluster’s overall performance.

Kubectl Top

The kubectl top command, which is similar to the top command in Linux allows us to view and understand the CPU and RAM consumption levels of our pods and nodes.

The below command will output the CPU and RAM usage of all the pods in the cluster.

kubectl top pods

The below command will do the same but for all the nodes in the cluster.

kubectl top nodes

In the output you can see that the CPU usage, used memory in bytes and percentage.

NAME                      CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
aks-agentpool-vmss000000   181m         9%     2252Mi          49%       

Success! You're on the list.