# One definition that creates an Application for every folder under apps/. # Adding a folder to the repository adds an application. Deleting the folder # removes it. Nothing is clicked. --- apiVersion: argoproj.io/v1alpha1 kind: ApplicationSet metadata: name: platform-apps namespace: argocd spec: # This only matters if the ApplicationSet itself is deleted. True means the # platform services keep running, unmanaged, until someone decides what to do. # False means deleting one object removes every platform service at once. syncPolicy: preserveResourcesOnDeletion: true generators: - git: repoURL: https://github.com/your-org/your-cluster-config.git revision: main directories: - path: apps/* # Folders starting with an underscore contain shared pieces that other # applications include, so they get no Application of their own. - path: apps/_* exclude: true template: metadata: name: "{{path.basename}}" finalizers: - resources-finalizer.argocd.argoproj.io annotations: # Only commits touching this application's own folder trigger a # refresh, so a busy repository does not make every app regenerate. argocd.argoproj.io/manifest-generate-paths: "." spec: project: platform source: repoURL: https://github.com/your-org/your-cluster-config.git targetRevision: main path: "{{path}}" destination: server: https://kubernetes.default.svc namespace: "platform-{{path.basename}}" syncPolicy: automated: prune: true selfHeal: true syncOptions: - CreateNamespace=true - ServerSideApply=true retry: limit: 5 backoff: duration: 10s factor: 2 maxDuration: 5m