2025-05-26 12:18:57 -05:00
|
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
|
|
|
kind: Cluster
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres
|
|
|
|
|
spec:
|
2026-01-15 22:40:57 -06:00
|
|
|
instances: 1
|
2025-09-09 23:27:48 -05:00
|
|
|
enablePDB: false
|
2025-05-26 12:18:57 -05:00
|
|
|
storage:
|
2026-01-15 22:40:57 -06:00
|
|
|
size: 100Gi
|
2025-05-26 12:18:57 -05:00
|
|
|
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
|
2025-05-26 23:37:24 -05:00
|
|
|
- name: matrix
|
|
|
|
|
ensure: present
|
|
|
|
|
comment: Matrix DB user
|
|
|
|
|
login: true
|
|
|
|
|
superuser: false
|
|
|
|
|
passwordSecret:
|
|
|
|
|
name: postgres-user-matrix
|
2025-09-09 23:27:48 -05:00
|
|
|
|
|
|
|
|
plugins:
|
|
|
|
|
- name: barman-cloud.cloudnative-pg.io
|
2025-10-19 21:48:30 -05:00
|
|
|
isWALArchiver: true
|
2025-09-09 23:27:48 -05:00
|
|
|
parameters:
|
|
|
|
|
barmanObjectName: k3sbackup-objectstore
|
|
|
|
|
|
2025-11-02 23:45:16 -06:00
|
|
|
# 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
|
2025-09-09 23:27:48 -05:00
|
|
|
# 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
|
2025-05-27 19:16:11 -05:00
|
|
|
---
|
|
|
|
|
apiVersion: postgresql.cnpg.io/v1
|
|
|
|
|
kind: ScheduledBackup
|
|
|
|
|
metadata:
|
|
|
|
|
name: postgres-backup
|
|
|
|
|
spec:
|
|
|
|
|
immediate: true # Create one when this is added to the cluster
|
2025-09-09 23:27:48 -05:00
|
|
|
schedule: "0 1 0 * * *" # 1AM, nightly
|
2025-05-27 19:16:11 -05:00
|
|
|
backupOwnerReference: self
|
|
|
|
|
cluster:
|
|
|
|
|
name: postgres
|
2025-10-19 21:48:30 -05:00
|
|
|
method: plugin
|
|
|
|
|
pluginConfiguration:
|
|
|
|
|
name: barman-cloud.cloudnative-pg.io
|