V2 Metrics API - Can I get Kubernetes CPU requests for a pod?

Hello DT Community,

It seems that in the V2 Metrics API that there is no way to get pod CPU requests. I can get pod CPU usage, pod CPU limits, pod memory usage, pod memory limits, and pod memory requests.

Is there a way to do this without doing a derived stat? Bigger question is there value in that stat?

Any advice is appreciated.

Thanks!

Hi @crabbylou,

I have not seen any problem with the Metric API regarding CPU request of a POD.

I used this metric selector expression at the Metric API:

Response part1:

Response part2, this pod has 1 core cpu requests:

Best regards,

János

Thanks for responding Mizso. Is there a way to get all the pods CPU requests for a namespace or workload?

The best I can get is the total. I cannot get it by pod name. The Classic UI graphs do a funky thing of taking the requests for the workload, and then divide by the number of running pods.

I can do this in Grail, because they have an actual stat to do that, but I am still tied to the V2 API for now.

Thanks!

Hi @crabbylou,

Unfortunately I do not know soultion for this request.

Maybe the other community members have any ideas about it.

Best regards,

János