Files
nexus/wiki/concepts/Cluster-Autoscaler.md

1.6 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
Cluster Autoscaler concept
Kubernetes
EKS
Autoscaling
Node
AWS
ASG
ctp-topic-64-scaling-out-with-amazon-eks
ctp-topic-70-eks-deployment-using-iac
2026-04-28

Definition

Cluster Autoscaler 是 Kubernetes 官方的节点Node级别扩缩容组件通过联动 AWS Auto Scaling GroupASG或托管节点组Managed Node Group根据集群内 Pending Pod 的数量和资源请求自动调整节点数量。

Key Mechanisms

  • 扩缩容决策依据:集群内 Pending Pod 的数量(而非直接基于资源利用率)
  • 资源请求感知:考虑 Pod 的 CPU/内存 requests不仅仅是当前实际使用量
  • ASG/节点组联动:更新 ASG 或托管节点组的期望容量Desired Capacity
  • Auto-discovery 模式:推荐使用,自动发现和管理 ASG
  • Mixed Instances Policy:支持在同一 ASG 中混合使用多种 EC2 实例类型
  • 配置变更min/max 配置变更应在 ASG/托管节点组层面操作,而非直接修改 Cluster Autoscaler

Relationship with Karpenter

  • Cluster Autoscaler:基于节点组间接扩缩容,响应相对较慢
  • Karpenter:直接与 EC2 API 交互,响应更快速灵活,是 Cluster Autoscaler 的演进方案

Limitations

  • 依赖预配置的 ASG/节点组,灵活性受限
  • 扩容速度受 ASG 启动新实例的速度限制
  • 无法处理需要特殊实例类型的工作负载

Sources