我在google kubernetes引擎(GKE)中设置了一个区域群集.节点组是每个区域中的单个vm(总共3个).我有一个部署,最少由HPA控制3个副本.所述节点组被配置为自动缩放(簇自动缩放又名CA).问题场景:
更新部署映像.Kubernetes自动创建新的pod,CA确定需要新节点.我现在有了4.当所有新的pod已经启动时,旧的pod会被删除,这意味着我拥有与前一分钟完全相同的CPU请求.但是在10分钟后最大缩小时间我还有4个节点.
现在,CPU对节点的请求是:
CPU Requests CPU Limits Memory Requests Memory Limits
------------ ---------- --------------- -------------
358m (38%) 138m (14%) 516896Ki (19%) 609056Ki (22%)
--
CPU Requests CPU Limits Memory Requests Memory Limits
------------ ---------- --------------- -------------
800m (85%) 0 (0%) 200Mi (7%) 300Mi (11%)
--
CPU Requests CPU Limits Memory Requests Memory Limits
------------ ---------- --------------- -------------
510m (54%) 100m (10%) 410Mi (15%) 770Mi (29%)
--
CPU …Run Code Online (Sandbox Code Playgroud) 我在 Google Kubernetes 集群上启用了自动缩放,并且我可以看到其中一个 Pod 的使用率要低得多
我总共有 6 个节点,我预计至少有这个节点被终止。我已经完成了以下操作: https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/FAQ.md#what-types-of-pods-can-prevent-ca-from-removing-a -节点
我已将此注释添加到我的所有 pod 中
cluster-autoscaler.kubernetes.io/safe-to-evict: true
Run Code Online (Sandbox Code Playgroud)
但是,集群自动缩放程序可以正确扩展,但不会像我预期的那样缩小。
我有以下日志
$ kubectl logs kube-dns-autoscaler-76fcd5f658-mf85c -n kube-system
autoscaler/pkg/autoscaler/k8sclient/k8sclient.go:90: Failed to list *v1.Node: Get https://10.55.240.1:443/api/v1/nodes?resourceVersion=0: dial tcp 10.55.240.1:443: getsockopt: connection refused
E0628 20:34:36.187949 1 reflector.go:190] github.com/kubernetes-incubator/cluster-proportional-autoscaler/pkg/autoscaler/k8sclient/k8sclient.go:90: Failed to list *v1.Node: Get https://10.55.240.1:443/api/v1/nodes?resourceVersion=0: dial tcp 10.55.240.1:443: getsockopt: connection refused
E0628 20:34:47.191061 1 reflector.go:190] github.com/kubernetes-incubator/cluster-proportional-autoscaler/pkg/autoscaler/k8sclient/k8sclient.go:90: Failed to list *v1.Node: Get https://10.55.240.1:443/api/v1/nodes?resourceVersion=0: net/http: TLS handshake timeout
I0628 20:35:10.248636 1 autoscaler_server.go:133] ConfigMap not found: Get https://10.55.240.1:443/api/v1/namespaces/kube-system/configmaps/kube-dns-autoscaler: net/http: TLS …Run Code Online (Sandbox Code Playgroud)