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.
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%