From 3355d6a7e79aa321c4ff627f11d16f961e3536b0 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Sun, 18 May 2025 22:24:22 -0400 Subject: [PATCH] added compose-apps --- charts/apps/argoapps/compose-apps/immich.yaml | 97 +++++++++++++++++++ .../apps/argoapps/templates/compose-apps.yaml | 26 +++++ charts/apps/argoapps/values.yaml | 9 +- 3 files changed, 131 insertions(+), 1 deletion(-) create mode 100644 charts/apps/argoapps/compose-apps/immich.yaml create mode 100644 charts/apps/argoapps/templates/compose-apps.yaml diff --git a/charts/apps/argoapps/compose-apps/immich.yaml b/charts/apps/argoapps/compose-apps/immich.yaml new file mode 100644 index 0000000..86e82cf --- /dev/null +++ b/charts/apps/argoapps/compose-apps/immich.yaml @@ -0,0 +1,97 @@ +services: + immich-server: + image: ghcr.io/immich-app/immich-server:release + volumes: + upload: /usr/src/app/upload + envFrom: + - secretRef: + name: immich-shared + ports: + - port: '2283' + restart: always + + immich-machine-learning: + image: ghcr.io/immich-app/immich-machine-learning:release + volumes: + model-cache: /cache + envFrom: + - secretRef: + name: immich-shared + restart: always + + redis: + image: docker.io/valkey/valkey:8-bookworm@sha256:42cba146593a5ea9a622002c1b7cba5da7be248650cbb64ecb9c6c33d29794b1 + healthcheck: + test: redis-cli ping || exit 1 + restart: always + + database: + image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52 + environment: + POSTGRES_INITDB_ARGS: '--data-checksums' + volumes: + db-data: /var/lib/postgresql/data + healthcheck: + test: >- + pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; + interval: 5m + start_interval: 30s + start_period: 5m + command: >- + postgres -c shared_preload_libraries=vectors.so -c 'search_path="$$user", public, vectors' -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on + restart: always + +volumes: + model-cache: + db-data: + type: nfs-provider + size: 200Mi + upload: + type: nfs-provider + family_storage: + type: nfs + server: tnas1.lab.internal + path: /mnt/EightTerra/FamilyStorage + +secrets: + immich-shared: + - name: DB_USERNAME + aliases: + - POSTGRES_USER + value: immich + - name: DB_DATABASE_NAME + aliases: + - POSTGRES_DB + value: immich + - name: DB_HOSTNAME + value: database + - name: REDIS_HOSTNAME + value: redis + +externalSecrets: + generators: + db-password: + length: 16 + digits: 5 + symbols: 5 + symbolCharacters: "-_$@" + noUpper: false + allowRepeat: true + secrets: + db-password: + refreshPolicy: "CreatedOnce" + target: + name: immich-shared + creationPolicy: Merge + deletionPolicy: Merge + template: + engineVersion: v2 + data: + POSTGRES_PASSWORD: "{{`{{.password}}`}}" + DB_PASSWORD: "{{`{{.password}}`}}" + dataFrom: + - sourceRef: + generatorRef: + apiVersion: generators.external-secrets.io/v1alpha1 + kind: Password + name: "db-password" \ No newline at end of file diff --git a/charts/apps/argoapps/templates/compose-apps.yaml b/charts/apps/argoapps/templates/compose-apps.yaml new file mode 100644 index 0000000..2f6f36b --- /dev/null +++ b/charts/apps/argoapps/templates/compose-apps.yaml @@ -0,0 +1,26 @@ +{{ range $fileName, $_ := .Files.Glob "compose-apps/*.yaml" }} +{{- $data := $.Files.Get $fileName | fromYaml -}} +{{- $name := ($data.name | default ($fileName | base | trimSuffix ".yaml")) }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: "{{ $name }}" + namespace: {{ $.Values.ns.argocd }} +spec: + project: main + source: + path: 'charts/compose-app' + repoURL: git@github.com:{{ $.Values.gitops.repo }}.git + targetRevision: {{ $.Values.gitops.revision }} + helm: + values: |- + {{ $data | toYaml | nindent 16 }} + destination: + namespace: comap-{{ $data.namespace | default $name }} + server: https://kubernetes.default.svc + syncPolicy: + automated: + prune: true + selfHeal: true +{{ end }} \ No newline at end of file diff --git a/charts/apps/argoapps/values.yaml b/charts/apps/argoapps/values.yaml index 9c80d89..0a4d919 100644 --- a/charts/apps/argoapps/values.yaml +++ b/charts/apps/argoapps/values.yaml @@ -1,2 +1,9 @@ ns: - argocd: plugin-argo-cd \ No newline at end of file + argocd: plugin-argo-cd +global: + nfs: + storageClassName: "" + storageProvider: "" +gitops: + repo: asosnovsky/homelab + revision: HEAD \ No newline at end of file