Files
homelab/postgres/cluster.yaml

39 lines
1.0 KiB
YAML

---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres-cluster
namespace: postgres-system
spec:
instances: 3
minSyncReplicas: 1
maxSyncReplicas: 1
primaryUpdateStrategy: unsupervised
certificates:
serverAltDNSNames:
- postgres.home
- localhost
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 EXTENSION IF NOT EXISTS "uuid-ossp";'
- '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