核心概念速览
一个最小 Application
落地要点
- CI 与 CD 分工:GitLab CI 构建镜像并更新配置仓库的 tag,Argo CD 检测到变化后发布
- 回滚:Git 里 revert 一次提交即可,历史即审计日志
- 渐进式发布:需要金丝雀时配合 Argo Rollouts
延伸阅读
- CI/CD & GitOps 概述
- Kubernetes 生产实践:GitOps 的运行环境
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
GitOps 持续交付:Git 仓库驱动集群状态
| 概念 | 说明 |
|---|---|
| Application | Argo CD 的核心 CRD,定义”哪个仓库的哪个目录部署到哪个集群” |
| 期望状态 vs 实际状态 | 仓库是事实来源,集群实时状态向它对齐 |
| Sync 策略 | 手动确认同步或自动同步(可带自愈) |
| ApplicationSet | 批量生成 Application(多环境、多集群) |
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
source:
repoURL: https://gitlab.example.com/ops/manifests.git
path: apps/my-app # 仓库里的配置目录
destination:
server: https://kubernetes.default.svc
namespace: my-app
syncPolicy:
automated: # 仓库一变就自动同步
selfHeal: true # 集群被手改了就改回来