You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何配置AWS集群Cluster Autoscaler仅基于CPU阈值缩容?

解决Cluster Autoscaler仅基于CPU利用率缩容的问题

要让Cluster Autoscaler只依据CPU利用率执行缩容操作,你需要在启动参数中添加--resource-ignore-list=memory,这个参数会让Autoscaler在评估节点是否可缩容时忽略内存利用率指标。

修改后的完整配置

- command:
  - ./cluster-autoscaler
  - --cloud-provider=aws
  - --namespace=kube-system
  - --node-group-auto-discovery=asg:tag=k8s.io/cluster-autoscaler/enabled,k8s.io/cluster-autoscaler/{my-cluster-name}
  - --logtostderr=true
  - --scale-down-utilization-threshold=0.4
  - --resource-ignore-list=memory
  - --skip-nodes-with-local-storage=false
  - --skip-nodes-with-system-pods=false
  - --stderrthreshold=info
  - --v=4

说明

添加--resource-ignore-list=memory后,Cluster Autoscaler会完全忽略内存利用率的数值,仅以你设置的--scale-down-utilization-threshold=0.4作为CPU利用率的判断标准,当节点CPU利用率低于该阈值时,才会将其纳入缩容候选范围。

验证方法

更新Cluster Autoscaler的Deployment后,查看日志,你会发现不再出现类似memory utilization too big的节点移除拒绝信息,所有缩容判断都会仅基于CPU利用率进行。

内容的提问来源于stack exchange,提问作者yuofvi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.25 08:27:38