4

In the Kubernetes dashboard, I can see for a HPA the following information:

Min Replicas:
3
Max Replicas:
11
Target CPU Utilization:
80%
Status
Current Replicas:
3
Desired Replicas:
3
Current CPU Utilization:
10%
Last Scaled:
5 days

However, I can't figure out how the 10% CPU utilization is calculated?

And if this value exposed via Prometheus?

4
  • 1
    10% is calculated as 10% of the requested resources in the deployment. So if you request 100mi, 10% is 10 milicores of CPU used. As for prometheus, I have no idea.
    – avi
    Commented Feb 24, 2019 at 13:06
  • And in the case of 3 replicas, do you know if this 10% is simply the average across the replicas?
    – Darragh
    Commented Feb 24, 2019 at 13:37
  • Yes, average of all replicas
    – avi
    Commented Feb 24, 2019 at 18:54
  • Did you ever find a way to get this in prometheus? I have the prom operator, kube-state-metrics, but the actual percent doesn't seem to be exposed anywhere. I would like to know the percent, not the desired/min/max/etc. replicas.
    – Lin Meyer
    Commented Apr 21, 2020 at 16:16

1 Answer 1

1

As we can see from kube-state-metrics/docs/horizontalpodautoscaler-metrics.md

We just need to have kube-state-metrics along with HPA to start getting metrics in prometheus.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.