问题描述
我正在使用ArgoCD,我想跟踪不同子目录下的文件。我已经将路径设置为./root_directory,但是我也想跟踪root_directory子目录中的文件。例如/ root_directory / dir1,/ root_directory / dir2,还包括/root_directory/dir1/dir1.1 ecc。 我该怎么办?
感谢您的帮助
解决方法
如果您想设置 ArgoCD 应用程序以递归方式浏览目录,则可以选择该配置。
UI 中有一个复选框用于递归和/或如果您以声明方式执行此操作,那么您可以看到 CRD https://argoproj.github.io/argo-cd/operator-manual/application.yaml 具有 spec.source.directory.recurse 选项。
,您可能应该为每个子目录创建不同的Argo应用程序。您已经决定在代码组织中对其进行细分,因此在Argo中对其进行细分可能同样有用。
,您可以添加 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