From 371e633027e375d0b8a1de06d219451235908e7d Mon Sep 17 00:00:00 2001 From: Michael Thomson Date: Sat, 7 Jun 2025 02:28:28 -0400 Subject: [PATCH] immich cnpg cluster --- immich/cluster.yaml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 immich/cluster.yaml diff --git a/immich/cluster.yaml b/immich/cluster.yaml new file mode 100644 index 0000000..fc30cff --- /dev/null +++ b/immich/cluster.yaml @@ -0,0 +1,44 @@ +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: immich-postgres +spec: + # At the time of writing, immich is only compatible with pgvecto.rs <0.4. Latest postgres image with that version is 16.5. + 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: 8Gi + storageClass: longhorn + + externalClusters: + - name: cluster-pg96 + connectionParameters: + # Use the correct IP or host name for the source database + host: "http://immich-postgresql.immich.svc.cluster.local:5432" + user: immich + dbname: immich + password: + name: immich-postgres-user + key: password