I am wondering how the CPU/Mem requests are calculated with respect to the state of the pods? Ideally I want to see the numbers of the Running pods and not all of the others like Completed, Error, ImagePullErr etc.
My total numbers differ a little (607 cores versus 657 cores) if I compare the following metrics query (towards the openshift cluster ) with the output of kube-capacity like this. compute-XX is what the worker nodes are called. Master nodes and other like infra nodes are not included in the counting.
_sum(sum(kube_pod_container_resource_requests{node=~"compute.",resource="cpu"}) by (namespace, pod, node) on (namespace,pod) group_left() (sum(kube_pod_statusphase{phase="Running"}) by (pod, namespace,node) == 1))
Hi
I am wondering how the CPU/Mem requests are calculated with respect to the state of the pods? Ideally I want to see the numbers of the Running pods and not all of the others like Completed, Error, ImagePullErr etc.
My total numbers differ a little (607 cores versus 657 cores) if I compare the following metrics query (towards the openshift cluster ) with the output of kube-capacity like this. compute-XX is what the worker nodes are called. Master nodes and other like infra nodes are not included in the counting.
_sum(sum(kube_pod_container_resource_requests{node=~"compute.",resource="cpu"}) by (namespace, pod, node) on (namespace,pod) group_left() (sum(kube_pod_statusphase{phase="Running"}) by (pod, namespace,node) == 1))
kube-capacity --node-labels node-role.kubernetes.io/worker NODE CPU REQUESTS CPU LIMITS MEMORY REQUESTS MEMORY LIMITS * 657424m (87%) 3156928m (421%) 2147320Mi (36%) 5018953Mi (86%)