Please help to understand the targetAverageUtilization on Horizontal Pod Autoscaler

103 views
Skip to first unread message

Yong Zhang

unread,
Jul 31, 2017, 10:46:18 PM7/31/17
to Kubernetes user discussion and Q&A
Hi, all

When studying Kubernetes HPA, I'm a little confused at targetAverageUtilization, for CPU metrics, if I understand the document correctly, 
targetAverageUtilization = (heapstervalue) / (pod request cpu) * 100%

Here request cpu is defined in yaml:
  resources:
    requests:
      cpu: 100m
      memory: 100Mi

So, if cpu metrics value from heapster is 200m, then targetAverageUtilization for cpu is 200%.
The question is, requested cpu value is the minimal resource usage I GUESS for pod scheduling, I don't know what's the actual cpu usage, maybe is much higher than 100m here, if I define the HPA threshold to 50%, but the physical host have enough sources available, this will cause unexpected autoscaling.
So I'm wondering why Kubernetes not use limit value as the base or host's total resource as the base? If above is the correct theory what Kubernetes is doing, how can I define a proper request value?

Thanks.       
Reply all
Reply to author
Forward
0 new messages