EKS 5 月更新:Karpenter v1 成为默认推荐 + EC2 节点启动加速

更新内容

亚马逊云科技 5 月对 EKS 做了两项关键更新:

1. Karpenter v1 成为新集群默认推荐节点调度器

  • 替代之前的 Cluster Autoscaler 推荐
  • 直接按 Pod 需求选实例,跳过 ASG 中间层
  • 扩容从 3-5 分钟缩短到 30 秒内

2. EC2 节点启动延迟改善

  • 节点从启动到就绪的时间缩短
  • 配合 Karpenter 使用效果叠加

技术对比

维度 Cluster Autoscaler Karpenter v1
工作流 Pod Pending→CA→ASG→EC2→注册 Pod Pending→Karpenter→EC2→注册
扩容时间 3-5 分钟 <30 秒
实例选择 Node Group 预定义 动态按需(价格+规格)
缩容策略 空闲超时后下线 主动整理 + 快速回收
Spot 支持 手动配多实例类型 内置 Spot 感知

NodePool 配置

apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
  name: default
spec:
  template:
    spec:
      requirements:
        - key: "karpenter.sh/capacity-type"
          operator: In
          values: ["spot", "on-demand"]
        - key: "node.kubernetes.io/instance-type"
          operator: In
          values: ["m5.large", "m5.xlarge", "m6i.large", "m6i.xlarge"]
      nodeClassRef:
        group: karpenter.k8s.aws
        kind: EC2NodeClass
        name: default
  disruption:
    consolidationPolicy: WhenEmptyOrUnderutilized
    consolidateAfter: 30s

从 Cluster Autoscaler 迁移

  1. 部署 Karpenter(Helm chart)
  2. 创建 NodePool + EC2NodeClass
  3. 灰度迁移工作负载到 Karpenter 管理节点
  4. 确认稳定后移除 CA + 对应 Node Group

需要注意 Karpenter 对 IAM 权限要求更高(需直接 EC2 API 调用权限)。


来源:亚马逊云科技 2026/5 月 EKS 更新

posted @ 2026-05-11 20:07  亚马逊云开发者  阅读(6)  评论(0)    收藏  举报