简体   繁体   中英

Understanding Kubernetes pod resource utilization in GCP monitoring

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM