robscott / kube-capacity

A simple CLI that provides an overview of the resource requests, limits, and utilization in a Kubernetes cluster
Apache License 2.0
2.09k stars 114 forks source link

feat(pod-count): display pod count conditionally for all type of printers #60

Closed bilalcaliskan closed 2 years ago

bilalcaliskan commented 2 years ago

What type of PR is this? /kind feature

What this PR does / why we need it: This PR displays pod counts for each node and for cluster, in the form of "${CURRENT}/${ALLOCATABLE}". This will help users to know how many pods are located on each node on the cluster and how many pods are located on the whole cluster.

Which issue(s) this PR fixes: Fixes #49

Special notes for your reviewer: This PR adds the displaying pod count functionality for all type of printers(table/json/yaml). I have also tried to cover the changes with current testing functions. We should pass --pod-count argument to the program. Sample output is as follows:

$ kube-capacity --pod-count

NODE           CPU REQUESTS   CPU LIMITS   MEMORY REQUESTS   MEMORY LIMITS   POD COUNT
*              950m (2%)      200m (0%)    284Mi (0%)        284Mi (0%)      10/220
minikube       850m (5%)      100m (0%)    231Mi (1%)        231Mi (1%)      8/110
minikube-m02   100m (0%)      100m (0%)    53Mi (0%)         53Mi (0%)       2/110
robscott commented 2 years ago

Thanks @bilalcaliskan! This looks like a great addition.

bilalcaliskan commented 2 years ago

@robscott build failed on master branch but i guess it is not related with this PR, complaining about constant naming.

robscott commented 2 years ago

No worries, I'll get a fix out soon, thanks for catching that!