Stewe
Stewe

Reputation: 139

ArgoCD tracking subdirectories in a specified path

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

Upvotes: 11

Views: 21291

Answers (3)

Rotem jackoby
Rotem jackoby

Reputation: 22198

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

Upvotes: 11

user2869522
user2869522

Reputation: 141

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.

Upvotes: 8

abldn
abldn

Reputation: 81

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.

Upvotes: 1

Related Questions