Closed mbarbero closed 2 years ago
Thanks for the bug report! Sorry for the late response to this one, I've been pretty underwater. This is a surprisingly tough one to get right. The per-node metrics shown here are not actually a sum of pod metrics, they represent the result of a NodeMetrics
API call (https://github.com/robscott/kube-capacity/blob/bb976088847ed85e4e9694a24aabe896a5ee4276/pkg/capacity/capacity.go#L135). My understanding of this is that it's a better representation of the full utilization of the node.
When filtering is applied, it likely would make more sense to fall back to a "sum of pod metrics" as the approach here, but that would require some restructuring. Don't have enough time to take this on short term, but I'm always open to PRs if someone does have time.
Thanks for the fix. It works very well!
I was expecting to see cpu/memory util only for pods in the given namespace, but it seems to include all pods, e.g.:
Similar output when filtering with
--namespace-labels
.WDYT?