apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: immich-postgres namespace: immich 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; import: type: microservice databases: - immich source: externalCluster: immich-postgresql storage: size: 8Gi storageClass: longhorn externalClusters: - name: immich-postgresql connectionParameters: # Use the correct IP or host name for the source database host: immich-postgresql user: immich dbname: immich password: name: immich-postgres-user key: password