Files
nixos/manifests/databases/postgres-cluster.yaml
T
Greg Hellings ee5389baea Install Helm as objects
Rather than running helm on the client and passing it to kubectl, just
install Flux and set the Helm repos on the server side

Add resolv.conf to the Kubernetes config so that the hosts can resolve
hostnames in order to pull down the Helm repositories

Add backups to the database configurations
2025-05-27 19:16:11 -05:00

59 lines
1.3 KiB
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres
spec:
instances: 3
storage:
size: 10Gi
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
backup:
retentionPolicy: "30d"
barmanObjectStore:
destinationPath: "s3://k3sbackup/postgres"
endpointURL: "http://s3.thehellings.lan:9000/"
s3Credentials:
accessKeyId:
name: k3sbackup
key: username
secretAccessKey:
name: k3sbackup
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 0 0 * * *" # Midnight, nightly
backupOwnerReference: self
cluster:
name: postgres