apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet metadata: name: haven-apps namespace: argocd spec: goTemplate: true goTemplateOptions: ["missingkey=error"] generators: - git: repoURL: https://git.ivanch.me/ivanch/haven-ops.git revision: main files: # one Application per .yaml under apps// - path: "apps/*/*.yaml" # never generate apps for the bootstrap/root manifests themselves - path: "apps/root/*.yaml" exclude: true template: metadata: # apps/default/notepad.yaml -> Application "notepad" name: '{{ .path.filename | trimSuffix ".yaml" }}' namespace: argocd finalizers: - resources-finalizer.argocd.argoproj.io spec: project: default source: repoURL: https://git.ivanch.me/ivanch/haven-ops.git targetRevision: main # in the git files generator .path.path IS the containing directory path: '{{ .path.path }}' directory: include: '{{ .path.filename }}' destination: server: https://kubernetes.default.svc namespace: '{{ index .path.segments 1 }}' syncPolicy: automated: prune: true selfHeal: true