--- title: "CTP Topic 70 EKS Deployment using IAC" type: source tags: - AWS - EKS - IaC - Kubernetes - CTP date: 2026-04-14 --- ## Source File - [[raw/Cloud & DevOps/Public-Cloud-Learning-Sessions/04_EKS/ctp-topic-70-eks-deployment-using-iac.md]] ## Summary - 核心主题:通过基础设施即代码(IaC)方式部署 EKS 集群 - 问题域:EKS 集群部署方式、容器与虚拟机对比、自定义网络和自动扩展 - 方法/机制:使用 Terraform 和 Service Catalog 两种 IaC 方式部署 EKS,ALB Ingress Controller 流量管理,EMI 自定义网络解决 CIDR 限制,Kubernetes Cluster Autoscaler 自动扩展 - 结论/价值:EKS 提供完全托管的控制平面,支持零停机滚动部署和 IAM RBAC 最小权限访问 ## Key Claims - EKS 是 AWS 提供的托管 Kubernetes 服务,具备完全托管的控制平面和工作节点自动扩展 - 容器相比虚拟机具有更快的启动时间、内存效率和可移植性优势 - 零停机滚动部署用于工作节点更新,IAM RBAC 映射实现最小权限访问 - 自定义网络(EMI)解决 Pod 的 CIDR 限制问题 ## Key Quotes > "EKS, a managed Kubernetes service by Amazon, offers features like fully managed control planes and autoscaling worker nodes." > "The discussion begins with the differences between VMs and containers, highlighting the benefits of containers such as reduced boot time, memory efficiency, and portability." ## Key Concepts - [[Infrastructure as Code (IaC)]]:通过代码方式定义和管理基础设施 - [[Kubernetes]]:用于弹性运行分布式系统的框架,支持自动化部署、回滚、负载均衡和 Pod 水平扩展 - [[EKS]]:Amazon EKS,AWS 的托管 Kubernetes 服务 - [[Terraform]]:HashiCorp 的 IaC 工具,用于定义 EKS 集群配置 - [[Service Catalog]]:AWS 服务目录,用于创建和管理 EKS 集群 - [[Cluster Autoscaler]]:Kubernetes 自动扩展器,根据资源需求自动扩展工作节点 - [[ALB Ingress Controller]]:AWS 负载均衡器入口控制器,用于流量管理 - [[CloudWatch]]:AWS 监控服务,结合 FluentBit 和 Container Insights 实现容器监控 - [[FluentBit]]:日志转发器,以 DaemonSet 形式部署到 EKS 集群 - [[Grafana]]:开源可视化平台,用于监控指标展示 ## Key Entities - [[AWS]]:公有云平台,提供 EKS 服务 - [[Terraform]]:IaC 工具供应商 - [[Kubernetes]]:CNCF 开发的容器编排平台 ## Connections - [[Infrastructure as Code (IaC)]] ← implements ← [[EKS]] - [[EKS]] ← manages ← [[Kubernetes]] - [[Cluster Autoscaler]] → scales → [[EKS Worker Nodes]] - [[ALB Ingress Controller]] → routes → [[EKS Services]] - [[CloudWatch]] ← monitors ← [[EKS Cluster]] ## Contradictions - (暂无)