Understanding Kubernetes pod resource utilization in GCP monitoring

10/23/2020

let's say I have the following resource requests:

  • cpu 25m
  • mem 256Mi

And I have the following limits:

  • cpu 1
  • mem 1Gi

And I have the following utilization

  • cpu 15.01%
  • mem 17.24%

Question... Is utilization % of limits or % of requests?

My presumption is it would be % of limits. So then if I want my cpu at 75% utilization I would just have to scale it down which would get me to 200m using the math below

(15.01%*1000)/0.75 = 200

Update

  • I was looking at GCP in the monitoring section of GKE pods
-- edmamerto
google-cloud-platform
kubernetes

1 Answer

10/23/2020

you are correct. kubectl top pod also presents the current usage in millicores, so it can also be used to calculate a possible limit reduction.

kubectl top pod  | grep prometheus-k8s | awk '{print $2}
405m

So I set my limit with. (405 * 100) / 75 = 540m

-- Kelson Martins
Source: StackOverflow