ArgoCD 跟踪指定路径中的子目录

Ste*_*ewe 10 openshift kubernetes kustomize gitops argocd

我正在使用 ArgoCD,我想跟踪不同子目录下的文件。我已将路径设置为 ./root_directory,但我还想跟踪 root_directory 子目录中的文件。例如 /root_directory/dir1、/root_directory/dir2,还有 /root_directory/dir1/dir1.1 ecc.. 我该怎么做?

感谢您的帮助

Rtm*_*tmY 10

您可以添加该spec.source.directory.recurse属性。

请参阅下面的示例:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: argocd-app
  namespace: argocd
spec:
  project: default
  source:
    path: some/path/
    repoURL: https://github.com/your-repo.git
    targetRevision: HEAD
    directory:
      recurse: true # <--- Here
  destination:
    namespace: '*'
    server: https://kubernetes.default.svc
  syncPolicy:
    automated:
      prune: true
Run Code Online (Sandbox Code Playgroud)


小智 7

如果您想设置 ArgoCD 应用程序以递归地遍历目录,则有一个用于该配置的选项。

UI 中有一个用于递归的复选框和/或如果您以声明方式执行此操作,则可以看到 CRD https://argoproj.github.io/argo-cd/operator-manual/application.yaml具有 spec.source .directory.recurse 选项。