Open christiancadieux opened 2 years ago
Hey @christiancadieux, thanks for reporting this! I'm not sure how soon I'll be able to fix this, but very open to PRs.
The same. I wil try to fix this
Thanks @cloud-66!
Seems to happen when the deployment requests / limits has been specified using M
rather than Mi
eg. we have a deployment where it's been entered as:
resources:
requests:
cpu: 500m
memory: 500M
limits:
cpu: 500m
memory: 500M
Then kubectl resource-capacity --pods
displays that deployment erroneously compared to all the others:
NODE NAMESPACE POD CPU REQUESTS CPU LIMITS MEMORY REQUESTS MEMORY LIMITS
aks-core-35064155-vmss000000 aqua aqua-sec-enforcer-fsdev-aks-foresight-muse2-ds-kkg7r 500m (12%) 500m (12%) 500000000000m (3%) 500000000000m (3%)
aks-core-35064155-vmss000000 kube-system azuredefender-collector-ds-n2kwh 60m (1%) 210m (5%) 64Mi (0%) 128Mi (1%)
aks-core-35064155-vmss000000 kube-system azuredefender-publisher-ds-9jz77 30m (0%) 60m (1%) 32Mi (0%) 200Mi (1%)
@christiancadieux @edrandall You should try, this issue was fixed by #71
in some cases, memory values for a node will not include the 'Mi' suffix:
In these cases, the report is wrong. need to change the logic here: https://github.com/robscott/kube-capacity/blob/master/pkg/capacity/resources.go#L356
for example, use more specific requestString and limitString so the code does not fall on the wrong unit: Example: add requestStringM() and limitStringM() that only converts Memory units to avoid the problem::