9

I'm using ArgoCD and I want to track files under different subdirectories. I've setted the path as ./root_directory, but I would like to track also files in the subdirectories of root_directory. For instance /root_directory/dir1, /root_directory/dir2, but also /root_directory/dir1/dir1.1 ecc.. How can I do that?

Thanks for your help

Stewe
  • 119
  • 1
  • 1
  • 8

3 Answers3

10

You can add the spec.source.directory.recurse attribute.

See an example below:

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
Rot-man
  • 18,045
  • 12
  • 118
  • 124
7

If you want to set up an ArgoCD Application to recursively go through directories there is an option for that configuration.

There is a checkbox in the UI for recursive and/or if you are doing it declaratively then you can see the CRD https://argoproj.github.io/argo-cd/operator-manual/application.yaml has the spec.source.directory.recurse option.

user2869522
  • 131
  • 1
  • 4
1

You should probably create different Argo Applications for each sub dir. You have decided to segmented them in your code organisation, therefore it may be equally useful to segment them in Argo.

abldn
  • 81
  • 3
  • I've found that there is a recurse option in argocd.. Otherwise is possible to add a kustomization file in each directory to track each subdirectory. But the argo app for each directory is a good idea. Thank you! – Stewe Oct 05 '20 at 12:45