Files
homelab/postgres/cluster.yaml

37 lines
983 B
YAML

---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres-cluster
namespace: postgres-system
spec:
instances: 3
minSyncReplicas: 0
maxSyncReplicas: 0
primaryUpdateStrategy: unsupervised
certificates:
serverAltDNSNames:
- postgres.dogar.dev
postgresql:
pg_hba:
- hostssl all shahab all cert
- hostssl all dogar all cert
- hostssl sameuser all all cert
- hostssl giteadb gitea 10.42.0.0/16 scram-sha-256
enableSuperuserAccess: false
bootstrap:
initdb:
database: postgres
secret:
name: postgres-password
postInitSQL:
- 'CREATE USER shahab SUPERUSER;'
- 'CREATE USER dogar SUPERUSER;'
- 'CREATE USER leviathan;'
- 'CREATE DATABASE leviathan;'
- 'CREATE USER "schedule-consist";'
- 'CREATE DATABASE "schedule-consist";'
- 'CREATE DATABASE giteadb;'
storage:
size: 1Gi