Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requests calculation method with respect to pod states #125

Open
bortek opened this issue Feb 14, 2024 · 0 comments
Open

Requests calculation method with respect to pod states #125

bortek opened this issue Feb 14, 2024 · 0 comments

Comments

@bortek
Copy link

bortek commented Feb 14, 2024

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_status_phase{phase="Running"}) by (pod, namespace,node) == 1))

image

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%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant