From 911456e16519e1e1cc6ab906ed3bb824f0c68e77 Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Sat, 27 Dec 2025 15:51:38 +0100 Subject: [PATCH] added DB-system --- database-system/postgresql/cluster.yaml | 60 +++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 database-system/postgresql/cluster.yaml diff --git a/database-system/postgresql/cluster.yaml b/database-system/postgresql/cluster.yaml new file mode 100644 index 0000000..37af966 --- /dev/null +++ b/database-system/postgresql/cluster.yaml @@ -0,0 +1,60 @@ +--- +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster +metadata: + name: postgresql + namespace: database-system +spec: + instances: 1 # Start with 1, scale to 3 later for HA + + # PostgreSQL version + imageName: ghcr.io/cloudnative-pg/postgresql:17.2 + + # Bootstrap + bootstrap: + initdb: + database: postgres + owner: postgres + secret: + name: postgres-superuser + + # Storage + storage: + storageClass: longhorn + size: 50Gi + + # Resources + resources: + requests: + memory: "512Mi" + cpu: "500m" + limits: + memory: "4Gi" + cpu: "2000m" + + # Monitoring + monitoring: + enablePodMonitor: true + + # Backup configuration (optional but recommended) + #backup: + # barmanObjectStore: + # destinationPath: s3://your-bucket/postgresql-backups/ + # Configure your S3-compatible storage here + # Or skip backups for now and add later + + # PostgreSQL configuration + postgresql: + parameters: + max_connections: "200" + shared_buffers: "256MB" + effective_cache_size: "1GB" + maintenance_work_mem: "64MB" + checkpoint_completion_target: "0.9" + wal_buffers: "16MB" + default_statistics_target: "100" + random_page_cost: "1.1" + effective_io_concurrency: "200" + work_mem: "2621kB" + min_wal_size: "1GB" + max_wal_size: "4GB"