1
0
Fork 0
This repository has been archived on 2025-08-23. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
mareshq-cthulhunetes-gitops/manifests/postgres/postgres.yaml

40 lines
997 B
YAML

apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: moving-moose
namespace: postgres
spec:
imageName: ghcr.io/cloudnative-pg/postgresql:16.0
instances: 3
primaryUpdateStrategy: unsupervised
primaryUpdateMethod: switchover
superuserSecret:
name: superuser-credentials
storage:
storageClass: longhorn-static
size: 100Gi
resources:
limits:
cpu: "4"
memory: 8Gi
requests:
cpu: "1"
memory: 8Gi
## Postgres configuration ##
# Enable 'postgres' superuser
enableSuperuserAccess: true
# Postgres instance parameters
postgresql:
parameters:
max_connections: "1000"
# High Availability configuration
minSyncReplicas: 1
maxSyncReplicas: 2
# Enable replication slots for HA in the cluster
replicationSlots:
highAvailability:
enabled: true
affinity:
enablePodAntiAffinity: true
topologyKey: topology.kubernetes.io/zone # default: kubernetes.io/hostname
podAntiAffinityType: required