Can we check if Kubernetes cluster have enough of resources before asking for new deployment On-Prem cluster?

Viewed 20

Do we have some Api in Kubernetes to know if we have enough resources to run deployment of pods before sending the request on prem envirenment?

the reason I need it is because I want to run a pod from another pod and I want to make sure I have enough of resources.

1 Answers

To get information about CPU(cores), CPU%, memory, and memory% usage of your nodes, you can run kubectl top nodes command.

For example:

1 kubectl top node --use-protocol-buffers
2 NAME           CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%
3 example-node   500m         50%    573Mi           20%
  • CPU(cores) - 500m means 500 millicpu. 1000m is equal to 1 CPU, hence 500m means 50% of 1 CPU.
  • CPU% - Total CPU usage percentage of that node.
  • Memory - Memory being used by that node.
  • Memory% - Total memory usage percentage of that node.
Related