From 96513f659c46d2347d9c4ae98a2c4494ac04f75a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20Groothuis?= Date: Sat, 25 Oct 2025 20:02:23 +0200 Subject: [PATCH] chore(immich): First immich deployment --- manifests/artemis/immich/db-cluster.yaml | 30 +++++++++++++++++++ manifests/artemis/immich/kustomization.yaml | 9 ++++-- manifests/artemis/immich/secret.yaml | 33 +++++++++++++++++++++ manifests/artemis/immich/values.yaml | 32 +++++++++++--------- manifests/artemis/immich/volumeClaims.yaml | 24 +++++++++++++++ 5 files changed, 112 insertions(+), 16 deletions(-) create mode 100644 manifests/artemis/immich/db-cluster.yaml create mode 100644 manifests/artemis/immich/secret.yaml create mode 100644 manifests/artemis/immich/volumeClaims.yaml diff --git a/manifests/artemis/immich/db-cluster.yaml b/manifests/artemis/immich/db-cluster.yaml new file mode 100644 index 0000000..5983887 --- /dev/null +++ b/manifests/artemis/immich/db-cluster.yaml @@ -0,0 +1,30 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: immich-postgres + namespace: immich +spec: + imageName: ghcr.io/tensorchord/cloudnative-pgvecto.rs:16.5-v0.3.0@sha256:be3f025d79aa1b747817f478e07e71be43236e14d00d8a9eb3914146245035ba + instances: 1 + postgresql: + shared_preload_libraries: + - "vectors.so" + managed: + roles: + - name: immich + superuser: true + login: true + bootstrap: + initdb: + database: immich + owner: immich + secret: + name: immich-postgres-user + postInitSQL: + - CREATE EXTENSION IF NOT EXISTS "vectors"; + - CREATE EXTENSION IF NOT EXISTS "cube" CASCADE; + - CREATE EXTENSION IF NOT EXISTS "earthdistance" CASCADE; + + storage: + size: 4Gi + storageClass: local-path diff --git a/manifests/artemis/immich/kustomization.yaml b/manifests/artemis/immich/kustomization.yaml index 84a2017..ab27342 100644 --- a/manifests/artemis/immich/kustomization.yaml +++ b/manifests/artemis/immich/kustomization.yaml @@ -4,9 +4,14 @@ kind: Kustomization metadata: name: immich +resources: + - secret.yaml + - db-cluster.yaml + - volumeClaims.yaml + helmCharts: - - name: immich/immich - repo: https://immich-app.github.io/immich-charts + - name: immich + repo: https://immich-app.github.io/immich-charts/immich version: 0.10.1 releaseName: immich namespace: immich diff --git a/manifests/artemis/immich/secret.yaml b/manifests/artemis/immich/secret.yaml new file mode 100644 index 0000000..e2eb6da --- /dev/null +++ b/manifests/artemis/immich/secret.yaml @@ -0,0 +1,33 @@ +--- +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: immich +spec: + refreshInterval: 1h + secretStoreRef: + name: platform + kind: ClusterSecretStore + target: + name: immich-postgres-user + data: + - secretKey: DB_USERNAME + remoteRef: + key: immich/db + property: DB_USERNAME + - secretKey: DB_DATABASE_NAME + remoteRef: + key: immich/db + property: DB_DATABASE_NAME + - secretKey: DB_PASSWORD + remoteRef: + key: immich/db + property: DB_PASSWORD + - secretKey: username + remoteRef: + key: immich/db + property: username + - secretKey: password + remoteRef: + key: immich/db + property: password diff --git a/manifests/artemis/immich/values.yaml b/manifests/artemis/immich/values.yaml index f0fb6f5..ccd5ad0 100644 --- a/manifests/artemis/immich/values.yaml +++ b/manifests/artemis/immich/values.yaml @@ -1,9 +1,3 @@ -## This chart relies on the common library chart from bjw-s -## You can find it at https://github.com/bjw-s-labs/helm-charts/tree/common-4.3.0/charts/library/common -## Refer there for more detail about the supported values - -# These entries are shared between all the Immich components - controllers: main: containers: @@ -13,7 +7,19 @@ controllers: env: REDIS_HOSTNAME: '{{ printf "%s-valkey" .Release.Name }}' IMMICH_MACHINE_LEARNING_URL: '{{ printf "http://%s-machine-learning:3003" .Release.Name }}' - # Add the env vars to connect to your database here. + DB_HOSTNAME: "{{ .Release.Name }}-postgres-rw.immich.svc.cluster.local" + DB_USERNAME: + secretKeyRef: + name: immich-postgres-user + key: username + DB_DATABASE_NAME: + secretKeyRef: + name: immich-postgres-user + key: DB_DATABASE_NAME + DB_PASSWORD: + secretKeyRef: + name: immich-postgres-user + key: password immich: metrics: @@ -24,7 +30,7 @@ immich: library: # Automatically creating the library volume is not supported by this chart # You have to specify an existing PVC to use - existingClaim: + existingClaim: immich-library-pvc # configuration is immich-config.json converted to yaml # ref: https://immich.app/docs/install/config-file/ # @@ -34,7 +40,7 @@ immich: # days: 30 # storageTemplate: # enabled: true - # template: "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}" + # template: "{{y}}/{{y}}-{{MM}}-{{dd}}/{{filename}}" # Dependencies @@ -98,12 +104,10 @@ machine-learning: pullPolicy: IfNotPresent env: TRANSFORMERS_CACHE: /cache + HF_XET_CACHE: /cache/huggingface-xet + MPLCONFIGDIR: /cache/matplotlib-config persistence: cache: enabled: true size: 10Gi - # Optional: Set this to persistentVolumeClaim to avoid downloading the ML models every start. - type: emptyDir - accessMode: ReadWriteMany - # storageClass: your-class - + existingClaim: immich-ml-pvc diff --git a/manifests/artemis/immich/volumeClaims.yaml b/manifests/artemis/immich/volumeClaims.yaml new file mode 100644 index 0000000..7f4ee20 --- /dev/null +++ b/manifests/artemis/immich/volumeClaims.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: immich-ml-pvc +spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: immich-library-pvc +spec: + storageClassName: local-path + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 250Gi