繁体   English   中英

Kubernetes : GKE | 即使内存利用率大于/等于目标值,HPA 也不会扩展 Pod

[英]Kubernetes : GKE | HPA is not scaling pods even though the memory utilization is greater/equal to target value

我们有一个 GKE 集群 (1.11) 并基于 Pod 的内存利用率实现了 HPA。 在我们的测试活动中,我们观察到 HPA 行为不一致,即使达到目标值,HPA 也没有扩展 Pod。 我们还注意到,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>

  • 集群版本:1.11.6
  • 云服务:GKE
  • 指标:内存
  • 目标:目标平均利用率

任何输入将不胜感激,并让我们知道我们是否可以调试 HPA 实现。

谢谢。

在计算此链接中指定的副本数时,HPA 中阈值的值存在容差

该容差默认为 0.1。 在您的配置中,由于这个原因,当您放置 90% 时,您可能不会达到阈值。 我建议您将指标更改为 80%,看看它是否有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM