Moved PSQL to NG
This commit is contained in:
1 parent
2676ecef5d
commit
bcfbfcd362
35 files changed
+32682
No files matched your search
@@ -0,0 +1,48 @@
|
||||
# Main HA PostgreSQL cluster: one primary and one streaming replica, each on its
|
||||
# own node with a node-local volume. Replication is asynchronous (nodes sit in
|
||||
# different regions), so a failover can lose the last few transactions.
|
||||
#
|
||||
# Nodes eligible for instances carry the label workload/postgres=true. To move a
|
||||
# replica: label the new node, unlabel the old one, then recreate the instance
|
||||
# (kubectl cnpg destroy main <N>); the operator re-clones it from the primary.
|
||||
#
|
||||
# Endpoints inside the cluster: main-rw (primary), main-ro (replicas),
|
||||
# main-r (any instance) in the psql namespace.
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: main
|
||||
namespace: psql
|
||||
spec:
|
||||
description: Main HA PostgreSQL cluster
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:17
|
||||
instances: 2
|
||||
enableSuperuserAccess: false
|
||||
|
||||
# Roll updates replica-first and hand over by switchover instead of restarting the primary.
|
||||
primaryUpdateStrategy: unsupervised
|
||||
primaryUpdateMethod: switchover
|
||||
|
||||
storage:
|
||||
storageClass: local-path
|
||||
size: 20Gi # local-path volumes cannot be expanded later
|
||||
|
||||
affinity:
|
||||
enablePodAntiAffinity: true
|
||||
podAntiAffinityType: required
|
||||
topologyKey: kubernetes.io/hostname
|
||||
nodeSelector:
|
||||
workload/postgres: "true"
|
||||
|
||||
resources:
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 1Gi
|
||||
limits:
|
||||
memory: 2Gi
|
||||
|
||||
postgresql:
|
||||
parameters:
|
||||
max_connections: "200"
|
||||
shared_buffers: 512MB
|
||||
effective_cache_size: 1536MB
|
||||
Reference in new issue
Block a user