title, type, tags, sources, last_updated
| title |
type |
tags |
sources |
last_updated |
| CoreDNS Scaling |
concept |
| Kubernetes |
| EKS |
| DNS |
| Scaling |
| Networking |
|
| ctp-topic-64-scaling-out-with-amazon-eks |
|
2026-04-28 |
Definition
CoreDNS Scaling 是 EKS 集群中 CoreDNS(Kubernetes 默认 DNS 服务)的水平扩缩容策略和优化实践,确保在高密度 Pod 环境下 DNS 查询的高可用性和低延迟。
Problem Statement
- EKS 集群规模增长时,Pod 间的 DNS 查询量呈指数增长
- 默认 CoreDNS 配置可能无法应对大规模集群的 DNS 负载
- DNS 查询延迟直接影响应用启动时间和运行时性能
Optimization Strategies
- HPA 扩缩容:为 CoreDNS Deployment 配置 HPA,基于 DNS 查询 QPS 或 CPU/内存利用率自动调整副本数
- Node Local DNS Cache:在每个节点部署本地 DNS 缓存(node-local-dns-cache 或 nodelocaldns),减少跨节点 DNS 查询
- 性能调优:调整 CoreDNS 的
cores-per-second 和 max-concurrent-queries 参数
- 副本数规划:建议 CoreDNS 副本数不低于集群节点数的 10-20%
Relationship with Node Local DNS Cache
- Node Local DNS Cache 通过在每节点运行本地 DNS 缓存 DaemonSet,拦截并缓存 Pod 的 DNS 查询
- 减少跨节点 DNS 查询流量,降低 DNS 查询延迟
- 与 CoreDNS HPA 扩缩容配合使用效果最佳
Sources