簡體   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