Files
nexus/wiki/sources/ctp-topic-64-scaling-out-with-amazon-eks.md

6.8 KiB
Raw Blame History

title, type, tags, sources, last_updated
title type tags sources last_updated
CTP Topic 64 Scaling out with Amazon EKS source
AWS
EKS
Kubernetes
Scaling
HPA
KEDA
Karpenter
Cluster-Autoscaler
ctp-topic-64-scaling-out-with-amazon-eks
2026-04-25

Source File

Summary用中文描述

  • 核心主题Amazon EKS 工作负载水平扩展与容量扩展的完整方法论,涵盖 Pod 级别扩展(事件驱动 + 指标驱动)和 Node 级别扩展ASG 联动 + 直接 API
  • 问题域:传统 HPA 仅支持 CPU/内存指标无法满足事件驱动型工作负载的零扩展需求Cluster Autoscaler 依赖预配置 ASG 导致灵活性不足EKS 集群 IP 地址耗尽问题CoreDNS 等集群组件扩缩容被忽视
  • 方法/机制HPA标准指标扩展→ KEDA事件驱动扩展→ Cluster AutoscalerASG 联动扩缩容)→ Karpenter/Carpenter直接 API 扩缩容)→ IPv6 解决 IP 耗尽 → API Server PPF + CoreDNS 缓存优化集群稳定性
  • 结论/价值EKS 扩缩容需 Pod 层KEDA和 Node 层Karpenter/Carpenter双管齐下HPA 负责 Pod 副本数调节,容量层通过原生云工具或第三方工具解决 IP 耗尽问题,集群组件扩缩容是生产部署常被忽视但至关重要的环节

Key Claims用中文描述

  • HPA 通过拉取 Metrics Server 的 CPU/内存指标计算应用工作负载所需的 Pod 副本数,默认支持标准资源指标,自定义/外部指标(如负载均衡器并发连接数、消息中间件队列深度)可通过 Custom Metrics API 扩展
  • KEDA 通过 ScaledObject CRD 实现事件驱动扩缩容,可将应用从零副本扩展,支持 Publishes Metrics 模式为 HPA 供数,实现指标驱动与事件驱动的混合扩展
  • Cluster Autoscaler 的扩缩容决策基于集群内 Pending Pod 的数量,联动 ASG/托管节点组调整期望容量,同时考虑 Pod 的 CPU/内存 requests支持 Mixed Instances Policy推荐使用 Auto-discovery 模式min/max 配置变更应在 ASG/托管节点组层面操作
  • Karpenter 是 AWS 开源的 Kubernetes 原生容量扩缩器,直接与 EC2 API 通信,支持动态按需供给(无需预配置节点组),通过 Provisioner 定义 EC2 实例需求并与工作负载的 node selector/affinity 匹配,默认禁用回收(需启用 TTL 或集群整合)
  • 为解决 IP 地址耗尽问题,推荐切换至 IPv6双栈 VPC节点双协议栈Pod 仅 IPv6若无法切换可使用 Carrier-Grade NATCGNAT配合自定义网络IPv6 Pod 与 IPv4 目标的交互通过双层 NAT 映射配置
  • CoreDNS 扩缩容和 Node Local DNS Cache 安装是 EKS 生产部署的重要优化项

Key Quotes

"The horizontal pod autoscaler is going to pull the metrics and it is going to calculate how many replicas are required for your application workload." — HPA 的核心机制:拉取指标 → 计算所需副本数

"The scaling decision that is made by the cluster auto scaler, it is done on the number of pending pods in the cluster." — Cluster Autoscaler 的决策依据Pending Pod 数量

"Carpenter has native integration with Kubernetes and it complements the native Kubernetes spot pod scheduling constraints that is available for your workloads." — Karpenter/Carpenter 与原生 K8s Spot Pod Disruption Budget 的互补关系

"The EKS best practices guides, specifically the scalability section." — 演讲者推荐的学习资源EKS Best Practices Guides

Key Concepts

  • Horizontal Pod Autoscaler (HPA)Kubernetes 标准 Pod 水平扩缩容机制,通过 CPU/内存指标或自定义/外部指标计算副本需求,支持 stabilization window 和 period seconds 配置防止震荡
  • KEDAKubernetes Event-Driven Autoscaling基于外部事件驱动的 K8s 扩缩容框架,通过 ScaledObject CRD 定义扩缩规则,支持从零副本扩展,可 Publish Metrics 给 HPA 实现混合扩展模式
  • Cluster AutoscalerKubernetes 官方节点扩缩容组件,联动 AWS ASG/托管节点组,根据 Pending Pod 数量和资源 requests 调整 Node 数量,推荐 Auto-discovery 模式
  • KarpenterAWS 开源的 Kubernetes 原生容量扩缩器,直接与 EC2 API 通信,通过 Provisioner 匹配工作负载需求,支持动态按需供给,默认禁用回收(需启用 TTL 或 Consolidation
  • IPv6-in-EKSEKS 集群解决 IP 地址耗尽的方案,推荐双栈 VPC 架构节点双协议栈Pod 仅 IPv6IPv6 Pod 与 IPv4 目标通过 NAT 映射通信
  • API-Server-Priority-and-FairnessEKS API Server 的优先级和公平性配置,用于在高负载下保护关键工作负载的 API 访问
  • CoreDNS-ScalingEKS 集群 CoreDNS 的水平扩缩容策略,配合 Node Local DNS Cache 降低 DNS 查询延迟
  • Metrics-ServerKubernetes 的 CPU/内存指标采集组件HPA 依赖其提供标准资源指标

Key Entities

  • SuravpulAWS 高级解决方案架构师Senior Solutions ArchitectCTP Topic 64 和 Topic 59、Topic 67 的讲师,专注 EKS 可靠性、可观测性和扩缩容实践
  • Amazon EKS:托管 Kubernetes 服务,本 Source Page 的目标平台
  • AWSAmazon Web ServicesEKS 及相关扩缩容工具KEDA、Karpenter的云服务提供商
  • Kubernetes开源容器编排平台HPA、Cluster Autoscaler、KEDA 的上游项目

Connections

Contradictions

  • ctp-topic-70-eks-deployment-using-iac 无实质冲突:
    • 冲突点:无
    • 当前观点Topic 64 提供扩缩容的完整方法论HPA/KEDA/Carpenter + IPv6 解决 IP 耗尽)
    • 对方观点Topic 70 仅简述 Cluster Autoscaler 实现 Worker Node 自动扩缩容,侧重 IaC 部署流程
    • 两者互补而非冲突Topic 70 是部署入口Topic 64 是扩缩容深化