Kubernetes 多集群管理实战:iDev 的 GitOps 实践
Kubernetes Multi-Cluster Management in Practice: iDev's GitOps Journey
| iDev Engineering | 2026-08-27T11:11:14
分享 iDev 如何使用 Argo CD 和 Kustomize 管理跨 3 个区域、12 个 Kubernetes 集群的应用部署,实现 GitOps 驱动的持续交付。
Sharing how iDev uses Argo CD and Kustomize to manage application deployments across 3 regions and 12 Kubernetes clusters, achieving GitOps-driven continuous delivery.
背景与挑战iDev 的基础设施分布在中国大陆、东南亚和日本三个区域,共运行 12 个 Kubernetes 集群。随着业务快速增长,传统的手动部署方式已无法满足频繁发版的需求。GitOps 架构设计仓库结构infra-config/ base/ # 基础配置 overlays/ cn-north/ # 华北区域 sg/ # 新加坡 jp/ # 日本 applications/ # Argo CD Application CRDs工具链Argo CD:GitOps 控制器,管理应用同步Kustomize:配置管理,实现环境差异化Sealed Secrets:加密敏感配置Argo Rollouts:渐进式发布(Canary/Blue-Green)多集群同步策略我们采用 Application Set 实现模板化的多集群部署。每个区域的配置差异通过 Kustomize overlay 管理,如镜像仓库地址、资源限制和环境变量。发布流程代码合并到 main 分支后,CI 自动构建镜像并更新 infra-config 仓库中的镜像 tag。Argo CD 检测到 Git 变更后,按照预设策略(先灰度后全量)依次同步各集群。监控与告警通过 Prometheus + Grafana 监控 Argo CD 同步状态,任何集群出现 OutOfSync 或 Degraded 状态超过 5 分钟即触发 PagerDuty 告警。成效实施 GitOps 后,部署频率从每周 2 次提升至每天 5 次,部署失败率从 8% 降至 0.5%,故障恢复时间从 45 分钟缩短至 8 分钟。
Background and ChallengesiDev's infrastructure spans three regions: mainland China, Southeast Asia, and Japan, running 12 Kubernetes clusters. With rapid business growth, traditional manual deployment could no longer keep up with frequent release demands.GitOps Architecture DesignRepository Structureinfra-config/ base/ # Base configuration overlays/ cn-north/ # North China region sg/ # Singapore jp/ # Japan applications/ # Argo CD Application CRDsToolchainArgo CD: GitOps controller managing application syncKustomize: Configuration management for environment differentiationSealed Secrets: Encrypted sensitive configurationsArgo Rollouts: Progressive delivery (Canary/Blue-Green)Multi-Cluster Sync StrategyWe use ApplicationSet for templated multi-cluster deployments. Regional configuration differences are managed through Kustomize overlays, such as image registry addresses, resource limits, and environment variables.Release ProcessAfter code merges to the main branch, CI automatically builds images and updates image tags in the infra-config repository. When Argo CD detects Git changes, it synchronizes clusters sequentially following preset strategies (canary first, then full rollout).Monitoring and AlertingWe use Prometheus + Grafana to monitor Argo CD sync status. Any cluster remaining OutOfSync or Degraded for more than 5 minutes triggers a PagerDuty alert.ResultsAfter implementing GitOps, deployment frequency increased from 2x weekly to 5x daily, deployment failure rate dropped from 8% to 0.5%, and incident recovery time was reduced from 45 minutes to 8 minutes.