我定义了一个节点池,最小实例设置为 1,最大实例设置为 5,并启用了自动缩放。
但它似乎并没有缩小规模。
- 我已经封锁了一个节点。
- 已经过去12个多小时了
- 没有待处理的 Pod
- 删除节点不会减少我自己的部署的副本数量
相关节点上运行以下 pod:
- fluentd
- kube-dns
- kube-proxy-gke
- 指标服务器
- redis
上面所有的 pod 都在kube-system
除了命名空间redis
pod 是在 daemonset 中定义的。
是否需要任何额外的配置?也许是 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>
有一些限制可能会阻止节点缩小规模。
您应该根据以下内容一一验证您列出的 pod哪些类型的 Pod 可以阻止 CA 删除节点? https://github.com/kubernetes/autoscaler/blob/cluster-autoscaler-1.2.2/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a-node文档。
这应该可以帮助您发现是否有 pod 阻止它。
如果确实是redis
pod 那么你可以尝试使用 safe to evict 注释:
"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"
如果它是系统 Pod 之一,我会在其他节点上尝试相同的操作,看看缩小规模是否适用于它们。
根据GKE 文档 https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler#minimum_and_maximum_node_pool_size,您应该能够将集群缩小到每个集群 1 个节点,或者完全针对特定节点池。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)