我们有一个GKE集群(1.11),并基于Pod的内存利用率实现了HPA。在我们的测试活动中,我们观察到HPA行为不一致,即使达到目标值,HPA也没有缩放豆荚。我们还注意到,HPA事件并未提供任何响应数据(按比例缩小或按比例缩小相关信息)。
kubectl获得hpa
NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
com-manh-cp-organization Deployment/com-manh-cp-organization 95%/90% 1 25 1 1d
kubectl描述hpa com-manh-cp-organization
Name: com-manh-cp-organization
Namespace: default
Labels: app=com-manh-cp-organization
stereotype=REST
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"autoscaling/v2beta1","kind":"HorizontalPodAutoscaler","metadata":{"annotations":{},"labels":{"app":"com-manh-cp-organizatio...
CreationTimestamp: Tue, 12 Feb 2019 18:02:12 +0530
Reference: Deployment/com-manh-cp-organization
Metrics: ( current / target )
resource memory on pods (as a percentage of request): 95% (4122087424) / 90%
Min replicas: 1
Max replicas: 25
Deployment pods: 1 current / 1 desired
Conditions:
Type Status Reason Message
---- ------ ------ -------
AbleToScale True ReadyForNewScale the last scale time was sufficiently old as to warrant a new scale
ScalingActive True ValidMetricFound the HPA was able to successfully calculate a replica count from memory resource utilization (percentage of request)
ScalingLimited False DesiredWithinRange the desired count is within the acceptable range
Events: <none>
我们将不胜感激任何输入,并告诉我们是否可以调试HPA实施。
谢谢。
答案 0 :(得分:1)
按此link.指定的计算副本数时,HPA中阈值的值存在容差
此公差默认为0.1。因此,在您的配置中,放置90%时可能未达到阈值。我建议您将指标更改为80%,然后查看它是否有效。