Files
k3s-configs/k3s/zidonghua_自动化/my-app-argocd.yaml
2026-01-21 09:45:33 +00:00

22 lines
925 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: k3s-configs-app
namespace: argocd # 必须部署在 ArgoCD 所在的命名空间
spec:
project: default # 使用默认项目
source:
repoURL: 'https://git.u9.net3w.com/fei/k3s-configs.git'
targetRevision: HEAD # 对应主分支main/master
path: '.' # 配置文件在仓库中的根目录
destination:
server: 'https://kubernetes.default.svc' # 部署到 ArgoCD 所在的当前集群
namespace: my-deploy-ns # 目标命名空间(会自动在该下创建资源)
# 自动化部署的关键配置
syncPolicy:
automated:
prune: true # 自动删除 Git 中已不存在的资源
selfHeal: true # 如果手动改了集群ArgoCD 会自动修复回 Git 的状态
syncOptions:
- CreateNamespace=true # 如果目标命名空间不存在,则自动创建