diff --git a/applicationsets/apps-tenants.yaml b/applicationsets/apps-tenants.yaml new file mode 100644 index 0000000..ded7274 --- /dev/null +++ b/applicationsets/apps-tenants.yaml @@ -0,0 +1,75 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: apps-tenants + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "100" +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - matrix: + generators: + - clusters: + selector: + matchLabels: + argocd.argoproj.io/secret-type: cluster + - list: + elements: + # protohype-team apps promoted to their own repos. + # Add one element per app; each carries its own source repo. + - app: slack-knowledge-bot + repoURL: https://github.com/nanohype/slack-knowledge-bot.git + path: chart + namespace: tenants-protohype + project: tenant-protohype + - app: digest-pipeline + repoURL: https://github.com/nanohype/digest-pipeline.git + path: chart + namespace: tenants-protohype + project: tenant-protohype + - app: incident-response + repoURL: https://github.com/nanohype/incident-response.git + path: chart + namespace: tenants-protohype + project: tenant-protohype + - app: competitive-intelligence + repoURL: https://github.com/nanohype/competitive-intelligence.git + path: chart + namespace: tenants-protohype + project: tenant-protohype + template: + metadata: + name: '{{ .app }}-{{ index .metadata.labels "environment" }}' + annotations: + argocd.argoproj.io/sync-wave: "100" + spec: + project: '{{ .project }}' + sources: + - repoURL: '{{ .repoURL }}' + targetRevision: main + path: '{{ .path }}' + helm: + valueFiles: + - $values/{{ .path }}/values.yaml + - $values/{{ .path }}/values-{{ index .metadata.labels "environment" }}.yaml + - repoURL: '{{ .repoURL }}' + targetRevision: main + ref: values + destination: + server: https://kubernetes.default.svc + namespace: '{{ .namespace }}' + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=false # Platform reconciler owns the Namespace + - ServerSideApply=true + retry: + limit: 5 + backoff: + duration: 5s + factor: 2 + maxDuration: 3m