gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Getting wrong values for a kubernetes pod

Open shubhindia opened this issue 3 years ago • 4 comments

Describe the bug I am using gopsutil to get CPU, memory and load usage for a particular pod (This is part of an internal logger). So when we use this (logger) in our CI (which is in kubernetes), instead of reporting the pod CPU and memory, it is reporting values for the node on which the pod is running. For e.g. We have a job which runs in a container which has 32GB memory, so it should return total memory as 34,359,738,368 bytes but instead it is returning 236447424512 which is around 236GB and this is node memory not the memory which was allocated to the pod.

Expected behavior It should return 34,359,738,368 instead of 236447424512

shubhindia avatar Jun 29 '22 14:06 shubhindia

Does this library plan to address this issue so that it can correctly calculate this for k8s pods or is this likely to stay the same?

aaronbuchwald avatar May 30 '23 20:05 aaronbuchwald

Any update here?

tangobango5 avatar Jan 30 '24 09:01 tangobango5

This issue still exists now

MUCZ avatar Sep 30 '24 03:09 MUCZ

Yes, I have an idea around this, will try it out once I get some free time.

shubhindia avatar Sep 30 '24 03:09 shubhindia