我们已经在GCP上的kubernetes上运行我们的工作量大约一年了,但是,上周,我们的一个网站遭到了网站所有者推出的促销活动的严重打击,但没有我们预先设定群集。
从那时起,我们一直在测试群集上加载测试堆栈,我们遇到的问题是使用Google节点,HPA不会按照文档中的说明进行扩展,而是始终扩展
2 - > 4 - > 8 - > 16 - > 32 --64--128
无论CPU负载如何。
例如,在我们的测试中,我们有251%/ 60%的cpu,其中有8个pod正在运行。我的数学建议(251/60)* 8 =需要33个豆荚,但是,它总是会下一个16,然后等到3分钟再到32个。
测试运行所需的横向扩展大约是64个吊舱,它在大约25分钟后到达,而不是8个,有没有办法让GCP版本的操作更像手册?
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
annotations:
autoscaling.alpha.kubernetes.io/conditions: '[{"type":"AbleToScale","status":"False","lastTransitionTime":"2017-11- 22T14:17:35Z","reason":"BackoffBoth","message":"the
time since the previous scale is still within both the downscale and upscale
forbidden windows"},{"type":"ScalingActive","status":"True","lastTransitionTime":"2017-11-21T19:09:34Z","reason":"ValidMetricFound","message":"the
HPA was able to succesfully calculate a replica count from cpu resource utilization
(percentage of request)"},{"type":"ScalingLimited","status":"False","lastTransitionTime":"2017-11-22T14:11:05Z","reason":"DesiredWithinRange","message":"the
desired replica count is within the acceptible range"}]'
autoscaling.alpha.kubernetes.io/current-metrics: '[{"type":"Resource","resource":{"name":"cpu","currentAverageUtilization":64,"currentAverageValue":"193m"}}]'
creationTimestamp: 2017-11-20T15:44:48Z
name: varnish-7
namespace: default
resourceVersion: "373498"
selfLink: /apis/autoscaling/v1/namespaces/default/horizontalpodautoscalers/varnish-7
uid: bd60211b-ce09-11e7-af0d-42010a8e0099
spec:
maxReplicas: 60
minReplicas: 2
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: varnish-7
targetCPUUtilizationPercentage: 50
status:
currentCPUUtilizationPercentage: 64
currentReplicas: 8
desiredReplicas: 8
lastScaleTime: 2017-11-22T14:16:05Z