-
Problem report
-
Resolution: Unresolved
-
Trivial
-
None
-
7.2.4
-
None
In template Kubernetes nodes by HTTP total requests/limits for a given node are calculated by summing up requests/limits of all pods present on it. However the template does not account the fact that only Running/Pending pods should be included into the calculation - and includes pods which are Completed or Failed.
Steps to reproduce:
- Have a kubernetes cluster observed by the Kubernetes nodes by HTTP template
- Have a node which has pods in a Completed and/or Failed states (for example, letfovers from cronjobs)
- See that requests/limits values reported on Zabbix are larger than actual values.
Proposed solution:
Update preprocessing step on Requests/Limits from:
$.Pods[?(@.hostname == "{#NAME}")].containers.<requests/limits>.<cpu/memory>.sum()
to
$.Pods[?(@.hostname == "{#NAME}" && (@.phase == "Running" || @.phase == "Pending"))].containers.<requests/limits>.<cpu/memory>.sum()
on the
kube.node.<requests/limits>.<cpu/memory>[{#NAME}]
item prototypes