Files
nixos/manifests/databases/postgres-cluster.yaml
T
Greg Hellings 89460c4e21 Upgrade Immich to v2.1.0
Move to using kustomize'd helm charts to deploy it
Update the new version of the helm chart, which has very different
values structure
Move database into the db namespace
Upgrade the db to include vectorchord
Upgrade CNPG to now include barman cloud natively
Migrate databases to Barman Cloud plugin, completely
Eliminate yet another shell script step in applying my k8s config
2025-10-19 21:48:30 -05:00

91 lines
2.2 KiB
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres
spec:
instances: 2
enablePDB: false
storage:
size: 20Gi
primaryUpdateStrategy: unsupervised
managed:
roles:
- name: gitlab
ensure: present
comment: Gitlab user
login: true
superuser: false
passwordSecret:
name: postgres-user-gitlab
- name: pgadmin
ensure: present
comment: PG Admin user
login: true
superuser: true
passwordSecret:
name: postgres-user-pgadmin
- name: matrix
ensure: present
comment: Matrix DB user
login: true
superuser: false
passwordSecret:
name: postgres-user-matrix
plugins:
- name: barman-cloud.cloudnative-pg.io
isWALArchiver: true
parameters:
barmanObjectName: k3sbackup-objectstore
# Use this as the target of the bootstrap recovery process
# It is important that the `externalClusters` serverName matches
# the old name of the original cluster that you are upgrading.
# When restoring, set the targetTime to the latest backup that you
# want to restore to
# bootstrap:
# recovery:
# source: origin
# recoveryTarget:
# targetTime: "2025-08-25 19:00:40+05"
# externalClusters:
# - name: origin
# plugin:
# name: barman-cloud.cloudnative-pg.io
# parameters:
# barmanObjectName: k3sbackup-objectstore
# serverName: postgres
---
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: k3sbackup-objectstore
spec:
configuration:
destinationPath: "s3://k3sbackup/postgres"
endpointURL: "http://s3.thehellings.lan:9000/"
s3Credentials:
accessKeyId:
name: k3sbackup-secret
key: username
secretAccessKey:
name: k3sbackup-secret
key: password
wal:
compression: gzip
---
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: postgres-backup
spec:
immediate: true # Create one when this is added to the cluster
schedule: "0 1 0 * * *" # 1AM, nightly
backupOwnerReference: self
cluster:
name: postgres
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io