GKE Autoscaling metrics in absolute value

2/24/2022

I am trying to set an horizontal pod autoscaling metrics on my GKE deployment based on absolute value but still didn't get the difference between the absolute value and the percentage :

let's say i'm requesting 500mCPU per Pod for a starting number of 3 pods.

If i want to replace the autoscaling metrics of "50% of CPU Usage" by an absolute value : will it be "250 mCPU" ?

is it based on an average user per pod or is it the total use for all the pods ?

thank you in advance

-- mohamed wael thabet
google-cloud-platform
google-kubernetes-engine
horizontal-pod-autoscaling
kubernetes

1 Answer

2/24/2022

If you use targetAverageValue ( or even targetAverageUtilization ), the metric value used by the scaling algorithm is based on the average across all matching pods.

From the Horizontal Pod Autoscaling docs:

When a targetAverageValue or targetAverageUtilization is specified, the currentMetricValue is computed by taking the average of the given metric across all Pods in the HorizontalPodAutoscaler's scale target.

-- Gari Singh
Source: StackOverflow