kube-capacity icon indicating copy to clipboard operation
kube-capacity copied to clipboard

Add option to only display nodes/pods that are above/over a specified resource utilization threshold

Open dpedu opened this issue 2 years ago • 0 comments

This is a suggestion for a feature to add to kube-capacity that I believe would be useful, at least for myself.

Add command line flags to only display nodes/pods that are above/over a specified resource utilization threshold.

Examples:

  • kube-capacity --max-mem-limit 50 - would only list nodes where the sum of memory limits of pods on the node are 50% or less of the node's memory capacity.
  • kube-capacity --min-mem-limit 50 - only list nodes where the above calculation is 50% or more
  • --max-mem-request and --min-mem-request should be self-explanatory given the above - same logic, but requests instead of limits.
  • --max-cpu-limit, --min-cpu-limit, --max-cpu-request, --min-cpu-request would work the same as the above flags, but for cpu requests/limits instead of memory.

I think these filters would make it easier to spot nodes that have low or high utilization. Currently, the tool lists all nodes/pods in a list, which is not ideal as one needs to manually look through this list, which is difficult for large clusters. Myself, I deal with some clusters with 100+ nodes and manually looking through the list of all nodes inconvenient. Since I want and expect my nodes to have >80% utilization, having filters like these would allow folks to configure this tool to output only nodes of concern, which is a better user experience.

dpedu avatar May 05 '23 19:05 dpedu