Files
auricom-home-cluster/kubernetes/apps/database/cloudnative-pg/cluster/cluster16.yaml
2024-09-17 01:11:39 +02:00

71 lines
2.1 KiB
YAML

---
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: postgres16
spec:
instances: 3 # set to the number of nodes in the cluster
imageName: ghcr.io/cloudnative-pg/postgresql:16.2-10
primaryUpdateStrategy: unsupervised
storage:
size: 50Gi
storageClass: openebs-hostpath
superuserSecret:
name: cloudnative-pg-secret
enableSuperuserAccess: true
resources:
requests:
cpu: 500m
limits:
memory: 4Gi
postgresql:
parameters:
max_connections: "600"
max_slot_wal_keep_size: 10GB
shared_buffers: 512MB
monitoring:
enablePodMonitor: true
# Ref: https://github.com/cloudnative-pg/cloudnative-pg/issues/2501
podMonitorMetricRelabelings:
- { sourceLabels: ["cluster"], targetLabel: cnpg_cluster, action: replace }
- { regex: cluster, action: labeldrop }
backup:
retentionPolicy: 30d
barmanObjectStore:
data:
compression: bzip2
wal:
compression: bzip2
maxParallel: 8
destinationPath: s3://postgresql/
endpointURL: https://s3.${SECRET_INTERNAL_DOMAIN}
# Note: serverName version needs to be inclemented
# when recovering from an existing cnpg cluster
serverName: postgres16-v4
s3Credentials:
accessKeyId:
name: cloudnative-pg-secret
key: aws-access-key-id
secretAccessKey:
name: cloudnative-pg-secret
key: aws-secret-access-key
# # Note: previousCluster needs to be set to the name of the previous
# # cluster when recovering from an existing cnpg cluster
# bootstrap:
# recovery:
# source: postgres16-v3
# externalClusters:
# - name: postgres16-v3
# barmanObjectStore:
# destinationPath: s3://postgresql/
# endpointURL: https://s3.${SECRET_INTERNAL_DOMAIN}
# s3Credentials:
# accessKeyId:
# name: cloudnative-pg-secret
# key: aws-access-key-id
# secretAccessKey:
# name: cloudnative-pg-secret
# key: aws-secret-access-key
# wal:
# maxParallel: 8