How to get the available resources (memory, cpu) in a K8s cluster?
You can use kubectl top
command to check the memory and CPU consumption of all the nodes or pods.
kubectl top nodes
For more information you can do,
kubectl top -h
For kubectl top command to work, you need to install metrics-server
in kubernetes cluster to fetch the CPU and memory metrics.