apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: php-test namespace: argocd spec: project: default # Git 仓库配置 source: repoURL: https://git.u9.net3w.com/fei/k3s-configs.git targetRevision: HEAD path: php-test/k8s # 目标集群 destination: server: https://kubernetes.default.svc namespace: php-test # 自动同步策略 syncPolicy: automated: prune: true # 自动删除 Git 中不存在的资源 selfHeal: true # 自动修复被手动修改的资源 allowEmpty: false syncOptions: - CreateNamespace=true # 自动创建命名空间 - PrunePropagationPolicy=foreground - PruneLast=true retry: limit: 5 backoff: duration: 5s factor: 2 maxDuration: 3m