From 8f044b62b3beb71e982a6b9bc4ded0b18a861c07 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Wed, 3 Dec 2025 16:18:01 +0100 Subject: [PATCH] feat: add foundation --- apps/root/README.md | 2 +- foundation/root/Chart.yaml | 6 +++ .../root/templates/_applicationset.yaml | 38 +++++++++++++++++++ foundation/root/templates/cloudnative-pg.yaml | 29 ++++++++++++++ foundation/root/templates/project.yaml | 15 ++++++++ foundation/root/values.yaml | 7 ++++ 6 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 foundation/root/Chart.yaml create mode 100644 foundation/root/templates/_applicationset.yaml create mode 100644 foundation/root/templates/cloudnative-pg.yaml create mode 100644 foundation/root/templates/project.yaml create mode 100644 foundation/root/values.yaml diff --git a/apps/root/README.md b/apps/root/README.md index e768789..c8186d2 100644 --- a/apps/root/README.md +++ b/apps/root/README.md @@ -20,7 +20,7 @@ It sets up: Run the following command to install the chart directly: ```bash -helm upgrade --install argocd-apps ./charts/argocd-apps \ +helm upgrade --install argocd-apps ./apps/root \ --namespace argocd ``` diff --git a/foundation/root/Chart.yaml b/foundation/root/Chart.yaml new file mode 100644 index 0000000..d78c8aa --- /dev/null +++ b/foundation/root/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: foundation +description: A Helm chart for the foundation of the homelab +type: application +version: 0.1.0 +appVersion: "1.0.0" diff --git a/foundation/root/templates/_applicationset.yaml b/foundation/root/templates/_applicationset.yaml new file mode 100644 index 0000000..9c7f860 --- /dev/null +++ b/foundation/root/templates/_applicationset.yaml @@ -0,0 +1,38 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: foundation + namespace: argocd +spec: + generators: + - git: + repoURL: {{ .Values.repoURL }} + revision: {{ .Values.targetRevision }} + directories: + - path: {{ .Values.path }}/* + - path: {{ .Values.path }}/*{{ .Values.exclude }} + exclude: true + template: + metadata: + name: '{{`{{path.basename}}`}}' + spec: + project: {{ .Values.project }} + source: + repoURL: {{ .Values.repoURL }} + targetRevision: {{ .Values.targetRevision }} + path: '{{`{{path}}`}}' + helm: + valueFiles: + - values.yaml + values: | + globals: + timezone: {{ .Values.globals.timezone }} + destination: + server: https://kubernetes.default.svc + namespace: foundation + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/foundation/root/templates/cloudnative-pg.yaml b/foundation/root/templates/cloudnative-pg.yaml new file mode 100644 index 0000000..284e549 --- /dev/null +++ b/foundation/root/templates/cloudnative-pg.yaml @@ -0,0 +1,29 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: cloudnative-pg-operator + namespace: argocd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: foundation + server: https://kubernetes.default.svc + project: foundation + source: + repoURL: https://cloudnative-pg.github.io/charts + targetRevision: 0.26.1 + chart: cloudnative-pg + helm: {} + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - ServerSideApply=true + - ApplyOutOfSyncOnly=true + - CreateNamespace=true + info: + - name: "Documentation: " + value: "https://cloudnative-pg.io/documentation/current/" diff --git a/foundation/root/templates/project.yaml b/foundation/root/templates/project.yaml new file mode 100644 index 0000000..bdf9134 --- /dev/null +++ b/foundation/root/templates/project.yaml @@ -0,0 +1,15 @@ +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: "{{ .Values.project }}" + namespace: argocd +spec: + description: "Project for homelab apps" + sourceRepos: + - "*" + destinations: + - namespace: foundation + server: https://kubernetes.default.svc + clusterResourceWhitelist: + - group: "*" + kind: "*" diff --git a/foundation/root/values.yaml b/foundation/root/values.yaml new file mode 100644 index 0000000..f9b292f --- /dev/null +++ b/foundation/root/values.yaml @@ -0,0 +1,7 @@ +repoURL: "https://github.com/morten-olsen/homelab-apps" +targetRevision: "main" +path: "foundation/charts" +exclude: "*.disabled" +project: "foundation" +globals: + timezone: Europe/Amsterdam \ No newline at end of file