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?

Darragh
  • 141
  • 1
  • 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 Feb 24 '19 at 13:06
  • And in the case of 3 replicas, do you know if this 10% is simply the average across the replicas? – Darragh Feb 24 '19 at 13:37
  • Yes, average of all replicas – avi Feb 24 '19 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 Apr 21 '20 at 16:16

1 Answers1

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.

Hashfyre
  • 441
  • 3
  • 5