代码之家  ›  专栏  ›  技术社区  ›  Chris Stryczynski

Kubernetes群集自动定标器似乎不适用于GKE?

  •  3
  • Chris Stryczynski  · 技术社区  · 7 年前

    我已经定义了一个节点池,其中min instances设置为1,max instances设置为5,并启用了自动缩放。

    然而,它似乎并没有缩小。

    • 我已经封锁了一个节点。
    • 已经超过12个小时了
    • 没有挂起的吊舱
    • 删除节点不会减少我自己部署的副本数量

    有问题的节点上运行以下播客:

    • 福伦特
    • 库贝DNS
    • 库贝代理GKE
    • 度量服务器
    • 小精灵

    上面所有的豆荚都在 kube-system 除了 redis 在守护程序集中定义的pod。

    是否需要其他配置?一个豆荚破坏预算也许?

    产量 kubectl describe -n kube-system configmap cluster-autoscaler-status :

    Name:         cluster-autoscaler-status
    Namespace:    kube-system
    Labels:       <none>
    Annotations:  cluster-autoscaler.kubernetes.io/last-updated=2018-06-15 10:40:16.289611397 +0000 UTC
    
    Data
    ====
    status:
    ----
    Cluster-autoscaler status at 2018-06-15 10:40:16.289611397 +0000 UTC:
    Cluster-wide:
      Health:      Healthy (ready=4 unready=0 notStarted=0 longNotStarted=0 registered=4 longUnregistered=0)
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:17:56.845900388 +0000 UTC
      ScaleUp:     NoActivity (ready=4 registered=4)
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:18:55.777577792 +0000 UTC
      ScaleDown:   NoCandidates (candidates=0)
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:39:03.33504599 +0000 UTC
    
    NodeGroups:
      Name:        https://content.googleapis.com/compute/v1/projects/gcpwp-ayurved-subs-staging/zones/europe-west1-b/instanceGroups/gke-wordpress-preempt-nodes-9c33afcb-grp
      Health:      Healthy (ready=3 unready=0 notStarted=0 longNotStarted=0 registered=3 longUnregistered=0 cloudProviderTarget=3 (minSize=2, maxSize=3))
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:17:56.845900388 +0000 UTC
      ScaleUp:     NoActivity (ready=3 cloudProviderTarget=3)
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:18:55.777577792 +0000 UTC
      ScaleDown:   NoCandidates (candidates=0)
                   LastProbeTime:      2018-06-15 10:40:14.942263061 +0000 UTC
                   LastTransitionTime: 2018-06-15 09:39:03.33504599 +0000 UTC
    
    
    Events:  <none>
    
    1 回复  |  直到 7 年前
        1
  •  2
  •   Sergey Bahchissaraitsev    7 年前

    有一些约束可以阻止节点缩小。

    你应该对照 What types of pods can prevent CA from removing a node? 文档。 这将帮助你发现是否有一个豆荚阻止它。

    如果真的是 redis pod然后您可以尝试使用safe逐出注释:

    "cluster-autoscaler.kubernetes.io/safe-to-evict": "true"
    

    如果它是一个系统pod,我会在其他节点上尝试同样的方法,看看是否可以缩小它们。 根据 GKE documentation ,您应该能够将集群缩小到每个集群1个节点,或者完全针对特定的节点池。

        2
  •  0
  •   Aleksi    6 年前

    也如所述 GKE FAQ ,节点将在 the sum of cpu and memory requests of all pods running on this node is smaller than 50% of the node's allocatable. here 一个重复的问题。