From 1c403e013cee18212f5d31bc528ee837103fab5d Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Wed, 3 Dec 2025 13:31:33 +0100 Subject: [PATCH] Argo (#34) * update * migrate remaining applications --- charts/apps/AGENT.md | 136 ------------------ .../Chart.yaml | 0 .../templates/client.yaml | 0 .../templates/config-map.yaml | 0 .../templates/deployment.yaml | 0 .../templates/external-http-service.yaml | 0 .../templates/pvc.yaml | 0 .../templates/service.yaml | 0 .../values.yaml | 0 charts/apps/install.sh | 12 -- .../Chart.yaml | 0 .../templates/client.yaml | 0 .../templates/database.yaml | 0 .../templates/deployment.yaml | 0 .../templates/external-http-service.yaml | 0 .../templates/http-service.yaml | 0 .../templates/pvc.yaml | 0 .../templates/secret.yaml | 0 .../templates/service.yaml | 0 .../values.yaml | 0 .../{mindsdb => mindsdb.disabled}/Chart.yaml | 0 .../templates/database.yaml | 0 .../templates/deployment.yaml | 0 .../templates/http-service.yaml | 0 .../templates/pvc.yaml | 0 .../templates/service.yaml | 0 .../{mindsdb => mindsdb.disabled}/values.yaml | 0 .../{nocodb => nocodb.disabled}/Chart.yaml | 0 .../templates/deployment.yaml | 0 .../templates/external-http-service.yaml | 0 .../templates/http-service.yaml | 0 .../templates/pvc.yaml | 0 .../templates/service.yaml | 0 .../{nocodb => nocodb.disabled}/values.yaml | 0 .../{siyuan => siyuan.disabled}/Chart.yaml | 0 .../apps/{siyuan => siyuan.disabled}/notes.md | 0 .../templates/config-pvc.yaml | 0 .../templates/deployment.yaml | 0 .../templates/external-http-service.yaml | 0 .../templates/http-service.yaml | 0 .../templates/secret.yaml | 0 .../templates/service.yaml | 0 .../{siyuan => siyuan.disabled}/values.yaml | 0 charts/argocd-apps/Chart.yaml | 6 + charts/argocd-apps/README.md | 60 ++++++++ .../argocd-apps/templates/applicationset.yaml | 40 ++++++ charts/argocd-apps/templates/project.yaml | 15 ++ charts/argocd-apps/values.yaml | 9 ++ 48 files changed, 130 insertions(+), 148 deletions(-) delete mode 100644 charts/apps/AGENT.md rename charts/apps/{headscale => headscale.disabled}/Chart.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/client.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/config-map.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/deployment.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/external-http-service.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/pvc.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/templates/service.yaml (100%) rename charts/apps/{headscale => headscale.disabled}/values.yaml (100%) delete mode 100755 charts/apps/install.sh rename charts/apps/{linkwarden => linkwarden.disabled}/Chart.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/client.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/database.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/deployment.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/external-http-service.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/http-service.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/pvc.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/secret.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/templates/service.yaml (100%) rename charts/apps/{linkwarden => linkwarden.disabled}/values.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/Chart.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/templates/database.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/templates/deployment.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/templates/http-service.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/templates/pvc.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/templates/service.yaml (100%) rename charts/apps/{mindsdb => mindsdb.disabled}/values.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/Chart.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/templates/deployment.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/templates/external-http-service.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/templates/http-service.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/templates/pvc.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/templates/service.yaml (100%) rename charts/apps/{nocodb => nocodb.disabled}/values.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/Chart.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/notes.md (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/config-pvc.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/deployment.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/external-http-service.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/http-service.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/secret.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/templates/service.yaml (100%) rename charts/apps/{siyuan => siyuan.disabled}/values.yaml (100%) create mode 100644 charts/argocd-apps/Chart.yaml create mode 100644 charts/argocd-apps/README.md create mode 100644 charts/argocd-apps/templates/applicationset.yaml create mode 100644 charts/argocd-apps/templates/project.yaml create mode 100644 charts/argocd-apps/values.yaml diff --git a/charts/apps/AGENT.md b/charts/apps/AGENT.md deleted file mode 100644 index e94f2e0..0000000 --- a/charts/apps/AGENT.md +++ /dev/null @@ -1,136 +0,0 @@ -# Agent Documentation - -This document describes how to create a new application chart for the homelab operator. - -## Chart Structure - -Each application has its own chart located in a directory under `charts/apps`. The chart should contain the following files: - -- `Chart.yaml`: The chart metadata. -- `values.yaml`: The default values for the chart. -- `templates/`: A directory containing the Kubernetes resource templates. - -## Custom Resources - -The homelab operator uses several custom resources to manage applications. These resources are defined in the `templates` directory of the chart. - -### `PostgresDatabase` - -If the application requires a PostgreSQL database, you can create a `PostgresDatabase` resource. The operator will automatically create a database and a secret containing the connection details. The secret will have the same name as the release with a `-pg-connection` postfix. - -Example: - -```yaml -# templates/database.yaml -apiVersion: homelab.mortenolsen.pro/v1 -kind: PostgresDatabase -metadata: - name: "{{ .Release.Name }}" -spec: - environment: "{{ .Values.globals.environment }}" -``` - -The secret has the following values: - -- `database`: name of the created database -- `host`: the hostname of the postgres server -- `port`: the port of the postgres server -- `url`: combined url in the format `postgresql://{user}:{password}@{host}:{port}/{database}` - -### `OidcClient` - -If the application requires OIDC authentication, you can create an `OidcClient` resource. The operator will automatically create an OIDC client and a secret containing the client ID and secret. The secret will have the same name as the release with a `-client` postfix. - -You need to specify the redirect URIs for the OIDC client. The subdomain is taken from the `values.yaml` file. - -Example: - -```yaml -# templates/client.yaml -apiVersion: homelab.mortenolsen.pro/v1 -kind: OidcClient -metadata: - name: "{{ .Release.Name }}" -spec: - environment: "{{ .Values.globals.environment }}" - redirectUris: - - path: /user/oauth2/Authentik/callback - subdomain: "{{ .Values.subdomain }}" - matchingMode: strict -``` - -The secret has the following value: - -- `authorization`: Authorization endpoint -- `clientId` -- `clientSecret` -- `configuration`: autodiscovery endpoint -- `configurationIssuer`: issuer url -- `endSession`: end session endpoint -- `jwks`: jwks endpoint -- `token`: token endpoint -- `userinfo`: user info endpoint - -### `HttpService` and `ExternalHttpService` - -To expose the application, you can use either an `HttpService` or an `ExternalHttpService` resource. - -- `HttpService`: This will expose the application through the Istio gateway. This is for internal access only. -- `ExternalHttpService`: This will expose the application through a CloudFlare tunnel. This is for external access. - -Both resources take a `subdomain` and a `destination` as parameters. The `destination` is the Kubernetes service to route traffic to. - -Example of `HttpService`: - -```yaml -# templates/http-service.yaml -apiVersion: homelab.mortenolsen.pro/v1 -kind: HttpService -metadata: - name: "{{ .Release.Name }}" -spec: - environment: "{{ .Values.globals.environment }}" - subdomain: "{{ .Values.subdomain }}" - destination: - host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local" - port: - number: 80 -``` - -Example of `ExternalHttpService`: - -```yaml -# templates/external-http-service.yaml -apiVersion: homelab.mortenolsen.pro/v1 -kind: ExternalHttpService -metadata: - name: "{{ .Release.Name }}" -spec: - environment: "{{ .Values.globals.environment }}" - subdomain: "{{ .Values.subdomain }}" - destination: - host: "{{ .Release.Name }}.{{ .Release.Namespace }}.svc.cluster.local" - port: - number: 80 -``` - -## `values.yaml` - -The `values.yaml` file should contain the following values: - -- `globals.environment`: The environment the application is running in (e.g., `prod`, `dev`). -- `image.repository`: The Docker image repository. -- `image.tag`: The Docker image tag. -- `subdomain`: The subdomain for the application. - -Example: - -```yaml -# values.yaml -globals: - environment: prod -image: - repository: docker.gitea.com/gitea - tag: latest -subdomain: gitea -``` diff --git a/charts/apps/headscale/Chart.yaml b/charts/apps/headscale.disabled/Chart.yaml similarity index 100% rename from charts/apps/headscale/Chart.yaml rename to charts/apps/headscale.disabled/Chart.yaml diff --git a/charts/apps/headscale/templates/client.yaml b/charts/apps/headscale.disabled/templates/client.yaml similarity index 100% rename from charts/apps/headscale/templates/client.yaml rename to charts/apps/headscale.disabled/templates/client.yaml diff --git a/charts/apps/headscale/templates/config-map.yaml b/charts/apps/headscale.disabled/templates/config-map.yaml similarity index 100% rename from charts/apps/headscale/templates/config-map.yaml rename to charts/apps/headscale.disabled/templates/config-map.yaml diff --git a/charts/apps/headscale/templates/deployment.yaml b/charts/apps/headscale.disabled/templates/deployment.yaml similarity index 100% rename from charts/apps/headscale/templates/deployment.yaml rename to charts/apps/headscale.disabled/templates/deployment.yaml diff --git a/charts/apps/headscale/templates/external-http-service.yaml b/charts/apps/headscale.disabled/templates/external-http-service.yaml similarity index 100% rename from charts/apps/headscale/templates/external-http-service.yaml rename to charts/apps/headscale.disabled/templates/external-http-service.yaml diff --git a/charts/apps/headscale/templates/pvc.yaml b/charts/apps/headscale.disabled/templates/pvc.yaml similarity index 100% rename from charts/apps/headscale/templates/pvc.yaml rename to charts/apps/headscale.disabled/templates/pvc.yaml diff --git a/charts/apps/headscale/templates/service.yaml b/charts/apps/headscale.disabled/templates/service.yaml similarity index 100% rename from charts/apps/headscale/templates/service.yaml rename to charts/apps/headscale.disabled/templates/service.yaml diff --git a/charts/apps/headscale/values.yaml b/charts/apps/headscale.disabled/values.yaml similarity index 100% rename from charts/apps/headscale/values.yaml rename to charts/apps/headscale.disabled/values.yaml diff --git a/charts/apps/install.sh b/charts/apps/install.sh deleted file mode 100755 index 3c72038..0000000 --- a/charts/apps/install.sh +++ /dev/null @@ -1,12 +0,0 @@ -set -euo pipefail - -find . -name "values.yaml" -type f -print0 | while IFS= read -r -d '' values_file; do - location=$(dirname "$values_file") - name=$(basename "$location") - name=$(echo "$name" | tr '[:upper:]' '[:lower:]' | tr -s '[:punct:][:space:]' '-' | sed -e 's/^-*//' -e 's/-*$//') - - echo "✅ Chart found in: $location" - echo " - Generated release name: $name" - HELM_COMMAND="helm install --namespace prod \"$name\" \"$location\"" - helm upgrade -i --namespace prod "$name" "$location" -done diff --git a/charts/apps/linkwarden/Chart.yaml b/charts/apps/linkwarden.disabled/Chart.yaml similarity index 100% rename from charts/apps/linkwarden/Chart.yaml rename to charts/apps/linkwarden.disabled/Chart.yaml diff --git a/charts/apps/linkwarden/templates/client.yaml b/charts/apps/linkwarden.disabled/templates/client.yaml similarity index 100% rename from charts/apps/linkwarden/templates/client.yaml rename to charts/apps/linkwarden.disabled/templates/client.yaml diff --git a/charts/apps/linkwarden/templates/database.yaml b/charts/apps/linkwarden.disabled/templates/database.yaml similarity index 100% rename from charts/apps/linkwarden/templates/database.yaml rename to charts/apps/linkwarden.disabled/templates/database.yaml diff --git a/charts/apps/linkwarden/templates/deployment.yaml b/charts/apps/linkwarden.disabled/templates/deployment.yaml similarity index 100% rename from charts/apps/linkwarden/templates/deployment.yaml rename to charts/apps/linkwarden.disabled/templates/deployment.yaml diff --git a/charts/apps/linkwarden/templates/external-http-service.yaml b/charts/apps/linkwarden.disabled/templates/external-http-service.yaml similarity index 100% rename from charts/apps/linkwarden/templates/external-http-service.yaml rename to charts/apps/linkwarden.disabled/templates/external-http-service.yaml diff --git a/charts/apps/linkwarden/templates/http-service.yaml b/charts/apps/linkwarden.disabled/templates/http-service.yaml similarity index 100% rename from charts/apps/linkwarden/templates/http-service.yaml rename to charts/apps/linkwarden.disabled/templates/http-service.yaml diff --git a/charts/apps/linkwarden/templates/pvc.yaml b/charts/apps/linkwarden.disabled/templates/pvc.yaml similarity index 100% rename from charts/apps/linkwarden/templates/pvc.yaml rename to charts/apps/linkwarden.disabled/templates/pvc.yaml diff --git a/charts/apps/linkwarden/templates/secret.yaml b/charts/apps/linkwarden.disabled/templates/secret.yaml similarity index 100% rename from charts/apps/linkwarden/templates/secret.yaml rename to charts/apps/linkwarden.disabled/templates/secret.yaml diff --git a/charts/apps/linkwarden/templates/service.yaml b/charts/apps/linkwarden.disabled/templates/service.yaml similarity index 100% rename from charts/apps/linkwarden/templates/service.yaml rename to charts/apps/linkwarden.disabled/templates/service.yaml diff --git a/charts/apps/linkwarden/values.yaml b/charts/apps/linkwarden.disabled/values.yaml similarity index 100% rename from charts/apps/linkwarden/values.yaml rename to charts/apps/linkwarden.disabled/values.yaml diff --git a/charts/apps/mindsdb/Chart.yaml b/charts/apps/mindsdb.disabled/Chart.yaml similarity index 100% rename from charts/apps/mindsdb/Chart.yaml rename to charts/apps/mindsdb.disabled/Chart.yaml diff --git a/charts/apps/mindsdb/templates/database.yaml b/charts/apps/mindsdb.disabled/templates/database.yaml similarity index 100% rename from charts/apps/mindsdb/templates/database.yaml rename to charts/apps/mindsdb.disabled/templates/database.yaml diff --git a/charts/apps/mindsdb/templates/deployment.yaml b/charts/apps/mindsdb.disabled/templates/deployment.yaml similarity index 100% rename from charts/apps/mindsdb/templates/deployment.yaml rename to charts/apps/mindsdb.disabled/templates/deployment.yaml diff --git a/charts/apps/mindsdb/templates/http-service.yaml b/charts/apps/mindsdb.disabled/templates/http-service.yaml similarity index 100% rename from charts/apps/mindsdb/templates/http-service.yaml rename to charts/apps/mindsdb.disabled/templates/http-service.yaml diff --git a/charts/apps/mindsdb/templates/pvc.yaml b/charts/apps/mindsdb.disabled/templates/pvc.yaml similarity index 100% rename from charts/apps/mindsdb/templates/pvc.yaml rename to charts/apps/mindsdb.disabled/templates/pvc.yaml diff --git a/charts/apps/mindsdb/templates/service.yaml b/charts/apps/mindsdb.disabled/templates/service.yaml similarity index 100% rename from charts/apps/mindsdb/templates/service.yaml rename to charts/apps/mindsdb.disabled/templates/service.yaml diff --git a/charts/apps/mindsdb/values.yaml b/charts/apps/mindsdb.disabled/values.yaml similarity index 100% rename from charts/apps/mindsdb/values.yaml rename to charts/apps/mindsdb.disabled/values.yaml diff --git a/charts/apps/nocodb/Chart.yaml b/charts/apps/nocodb.disabled/Chart.yaml similarity index 100% rename from charts/apps/nocodb/Chart.yaml rename to charts/apps/nocodb.disabled/Chart.yaml diff --git a/charts/apps/nocodb/templates/deployment.yaml b/charts/apps/nocodb.disabled/templates/deployment.yaml similarity index 100% rename from charts/apps/nocodb/templates/deployment.yaml rename to charts/apps/nocodb.disabled/templates/deployment.yaml diff --git a/charts/apps/nocodb/templates/external-http-service.yaml b/charts/apps/nocodb.disabled/templates/external-http-service.yaml similarity index 100% rename from charts/apps/nocodb/templates/external-http-service.yaml rename to charts/apps/nocodb.disabled/templates/external-http-service.yaml diff --git a/charts/apps/nocodb/templates/http-service.yaml b/charts/apps/nocodb.disabled/templates/http-service.yaml similarity index 100% rename from charts/apps/nocodb/templates/http-service.yaml rename to charts/apps/nocodb.disabled/templates/http-service.yaml diff --git a/charts/apps/nocodb/templates/pvc.yaml b/charts/apps/nocodb.disabled/templates/pvc.yaml similarity index 100% rename from charts/apps/nocodb/templates/pvc.yaml rename to charts/apps/nocodb.disabled/templates/pvc.yaml diff --git a/charts/apps/nocodb/templates/service.yaml b/charts/apps/nocodb.disabled/templates/service.yaml similarity index 100% rename from charts/apps/nocodb/templates/service.yaml rename to charts/apps/nocodb.disabled/templates/service.yaml diff --git a/charts/apps/nocodb/values.yaml b/charts/apps/nocodb.disabled/values.yaml similarity index 100% rename from charts/apps/nocodb/values.yaml rename to charts/apps/nocodb.disabled/values.yaml diff --git a/charts/apps/siyuan/Chart.yaml b/charts/apps/siyuan.disabled/Chart.yaml similarity index 100% rename from charts/apps/siyuan/Chart.yaml rename to charts/apps/siyuan.disabled/Chart.yaml diff --git a/charts/apps/siyuan/notes.md b/charts/apps/siyuan.disabled/notes.md similarity index 100% rename from charts/apps/siyuan/notes.md rename to charts/apps/siyuan.disabled/notes.md diff --git a/charts/apps/siyuan/templates/config-pvc.yaml b/charts/apps/siyuan.disabled/templates/config-pvc.yaml similarity index 100% rename from charts/apps/siyuan/templates/config-pvc.yaml rename to charts/apps/siyuan.disabled/templates/config-pvc.yaml diff --git a/charts/apps/siyuan/templates/deployment.yaml b/charts/apps/siyuan.disabled/templates/deployment.yaml similarity index 100% rename from charts/apps/siyuan/templates/deployment.yaml rename to charts/apps/siyuan.disabled/templates/deployment.yaml diff --git a/charts/apps/siyuan/templates/external-http-service.yaml b/charts/apps/siyuan.disabled/templates/external-http-service.yaml similarity index 100% rename from charts/apps/siyuan/templates/external-http-service.yaml rename to charts/apps/siyuan.disabled/templates/external-http-service.yaml diff --git a/charts/apps/siyuan/templates/http-service.yaml b/charts/apps/siyuan.disabled/templates/http-service.yaml similarity index 100% rename from charts/apps/siyuan/templates/http-service.yaml rename to charts/apps/siyuan.disabled/templates/http-service.yaml diff --git a/charts/apps/siyuan/templates/secret.yaml b/charts/apps/siyuan.disabled/templates/secret.yaml similarity index 100% rename from charts/apps/siyuan/templates/secret.yaml rename to charts/apps/siyuan.disabled/templates/secret.yaml diff --git a/charts/apps/siyuan/templates/service.yaml b/charts/apps/siyuan.disabled/templates/service.yaml similarity index 100% rename from charts/apps/siyuan/templates/service.yaml rename to charts/apps/siyuan.disabled/templates/service.yaml diff --git a/charts/apps/siyuan/values.yaml b/charts/apps/siyuan.disabled/values.yaml similarity index 100% rename from charts/apps/siyuan/values.yaml rename to charts/apps/siyuan.disabled/values.yaml diff --git a/charts/argocd-apps/Chart.yaml b/charts/argocd-apps/Chart.yaml new file mode 100644 index 0000000..72cdc74 --- /dev/null +++ b/charts/argocd-apps/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: argocd-apps +description: A Helm chart for ArgoCD ApplicationSet to deploy homelab apps +type: application +version: 0.1.0 +appVersion: "1.0.0" diff --git a/charts/argocd-apps/README.md b/charts/argocd-apps/README.md new file mode 100644 index 0000000..e768789 --- /dev/null +++ b/charts/argocd-apps/README.md @@ -0,0 +1,60 @@ +# ArgoCD Apps + +This Helm chart deploys an ArgoCD ApplicationSet and AppProject to manage homelab applications. + +## Description + +It sets up: +- **AppProject**: A project named `apps` (configurable) to group the applications. +- **ApplicationSet**: Automatically discovers and deploys Helm charts from `charts/apps/*` in the repository. + +## Prerequisites + +- Kubernetes cluster +- ArgoCD installed in the `argocd` namespace + +## Deployment + +### Option 1: Helm Install + +Run the following command to install the chart directly: + +```bash +helm upgrade --install argocd-apps ./charts/argocd-apps \ + --namespace argocd +``` + +### Option 2: ArgoCD App of Apps + +You can also deploy this chart using ArgoCD itself by creating an Application that points to this chart. + +```yaml +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: argocd-apps + namespace: argocd +spec: + project: default + source: + repoURL: https://github.com/morten-olsen/homelab-apps + targetRevision: main + path: charts/argocd-apps + destination: + server: https://kubernetes.default.svc + namespace: argocd + syncPolicy: + automated: + prune: true + selfHeal: true +``` + +## Configuration + +| Parameter | Description | Default | +|-----------|-------------|---------| +| `repoURL` | URL of the git repository | `https://github.com/morten-olsen/homelab-apps` | +| `targetRevision` | Git revision to use | `main` | +| `path` | Path to the apps directory | `charts/apps` | +| `exclude` | Pattern to exclude directories | `*.disabled` | +| `project` | ArgoCD project name | `apps` | diff --git a/charts/argocd-apps/templates/applicationset.yaml b/charts/argocd-apps/templates/applicationset.yaml new file mode 100644 index 0000000..d62085e --- /dev/null +++ b/charts/argocd-apps/templates/applicationset.yaml @@ -0,0 +1,40 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: homelab-apps + 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: + environment: {{ .Values.globals.environment }} + domain: {{ .Values.globals.domain }} + timezone: {{ .Values.globals.timezone }} + destination: + server: https://kubernetes.default.svc + namespace: prod + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true diff --git a/charts/argocd-apps/templates/project.yaml b/charts/argocd-apps/templates/project.yaml new file mode 100644 index 0000000..d3143b0 --- /dev/null +++ b/charts/argocd-apps/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: prod + server: https://kubernetes.default.svc + clusterResourceWhitelist: + - group: '*' + kind: '*' diff --git a/charts/argocd-apps/values.yaml b/charts/argocd-apps/values.yaml new file mode 100644 index 0000000..da61240 --- /dev/null +++ b/charts/argocd-apps/values.yaml @@ -0,0 +1,9 @@ +repoURL: "https://github.com/morten-olsen/homelab-apps" +targetRevision: "argo" +path: "charts/apps" +exclude: "*.disabled" +project: "apps" +globals: + environment: prod + domain: olsen.cloud + timezone: Europe/Amsterdam \ No newline at end of file