Quickly get the summary of total CPU
Copy $ kubectl get nodes -o jsonpath= '{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.cpu}{"\n"}{end}' | awk '{sum += $2} END {print "Total CPUs across all nodes: " sum}'
Quickly get the summary of total Memory
Copy $ kubectl get nodes -o jsonpath= '{range .items[*]}{.metadata.name}{"\t"}{.status.capacity.memory}{"\n"}{end}' | awk '{print $1 "\t" $2 / (1024 * 1024) " MB"}'
Inspect Current Utilization
Ensure that Metrics Server is installed in your Kubernetes cluster. If it's installed, you can query it to get CPU and memory usage information.
Copy $ kubectl top nodes | awk '{print $1, $2, $3, $4, ($5/1024/1024)"MB", $6}'
Using Kubernetes Dashboard
If you have Kubernetes Dashboard installed, you can also use it to view resource usage across your cluster.