apiVersion: postgresql.cnpg.io/v1 kind: Cluster metadata: name: timescale-cluster spec: instances: 3 imageName: timescale/timescaledb:2.15.3-pg15 # ✅ Initiales Setup bootstrap: initdb: database: app owner: app # ✅ Storage storage: size: 50Gi # ✅ Ressourcen (wichtig!) resources: requests: memory: "2Gi" cpu: "500m" limits: memory: "4Gi" cpu: "2" # ✅ High Availability affinity: enablePodAntiAffinity: true topologyKey: kubernetes.io/hostname # ✅ Monitoring monitoring: enablePodMonitor: true # ✅ PostgreSQL / Timescale Tuning postgresql: parameters: max_connections: "100" # mehr Verbindungen 200 shared_buffers: "256MB" # Cache im RAM 1GB effective_cache_size: "3GB" # Optimizer hint work_mem: "16MB" # pro Query maintenance_work_mem: "256MB" # für VACUUM/REINDEX wal_buffers: "16MB" checkpoint_completion_target: "0.9" random_page_cost: "1.1" # SSD optimiert effective_io_concurrency: "200" backup: retentionPolicy: "7d" # Backup älter als 7 Tage -> automatisch gelöscht barmanObjectStore: destinationPath: "s3://backups/" endpointURL: "http://minio.minio-system.svc.cluster.local:9000" s3Credentials: accessKeyId: name: s3-creds key: ACCESS_KEY_ID secretAccessKey: name: s3-creds key: SECRET_ACCESS_KEY wal: compression: gzip