add new postgres cluster

This commit is contained in:
2026-02-21 14:27:08 +01:00
parent 96cb5e53b1
commit d7e3a77f73
3 changed files with 90 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ resources:
- volume.yaml - volume.yaml
- redis.yaml - redis.yaml
- postgres-password.yaml - postgres-password.yaml
- postgres-volume.yaml
- postgres-cluster.yaml - postgres-cluster.yaml
- immich-library.yaml - immich-library.yaml
- release.yaml - release.yaml

View File

@@ -30,3 +30,59 @@ spec:
# https://github.com/cloudnative-pg/cloudnative-pg/issues/3788 # https://github.com/cloudnative-pg/cloudnative-pg/issues/3788
passwordSecret: passwordSecret:
name: immich-db-immich name: immich-db-immich
backup:
volumeSnapshot:
className: csi-mayastor-snapshotclass
---
apiVersion: postgresql.cnpg.io/v1
kind: Backup
metadata:
name: backup-migration
namespace: immich
spec:
method: volumeSnapshot
cluster:
name: immich-db
---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: immich-db-lvmhdd
namespace: immich
spec:
# TODO: Configure renovate to handle imageName
imageName: ghcr.io/tensorchord/cloudnative-vectorchord:14-0.4.3
instances: 1
storage:
pvcTemplate:
storageClassName: hdd-lvmpv
resources:
requests:
storage: 10Gi
volumeName: immich-db-lvmhdd-1
# Just to avoid bootstrapping the instance again
# I migrated data manually using pv_migrate because this feature is broken
# when source and target volumes are in different storage classes
# CNPG just sets dataSource to the PVC and expects the underlying storage
# to handle the migration, but it doesn't work here
bootstrap:
recovery:
backup:
name: backup-migration
# We need to create custom role because default one does not allow to set up
# vectorchord extension
managed:
roles:
- name: immich
createdb: true
login: true
superuser: true
# We need to manually create secret
# https://github.com/cloudnative-pg/cloudnative-pg/issues/3788
passwordSecret:
name: immich-db-immich

View File

@@ -0,0 +1,33 @@
apiVersion: local.openebs.io/v1alpha1
kind: LVMVolume
metadata:
labels:
kubernetes.io/nodename: anapistula-delrosalae
name: immich-db-lvmhdd-1
namespace: openebs
spec:
capacity: 10Gi
ownerNodeID: anapistula-delrosalae
shared: "yes"
thinProvision: "no"
vgPattern: ^openebs-hdd$
volGroup: openebs-hdd
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: immich-db-lvmhdd-1
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: hdd-lvmpv
volumeMode: Filesystem
csi:
driver: local.csi.openebs.io
fsType: btrfs
volumeHandle: immich-db-lvmhdd-1
---
# PVCs are dynamically created by the Postgres operator