Change Request limit of Postgresql¶
- apply the request limit, this will trigger master & replica pod to restarted.
- After applied, replica will be restarted automatically
- Since we use unsupervised with switchover, primary will switchover automatically
zufar.dhiyaullhaq@MacBookPro cnpg-learning % k get cluster NAME AGE INSTANCES READY STATUS PRIMARY echo-postgresql 10d 3 3 Cluster in healthy state echo-postgresql-14 k get pod echo-postgresql-14 -oyaml | grep resources -A 10 -- resources: limits: cpu: 500m memory: 1Gi requests: cpu: 100m memory: 512Mi
Manifests¶
cluster.yaml
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: echo-postgresql
namespace: cnpg-system
spec:
instances: 3
storage:
size: 20Gi
storageClass: gtf-ack-essd-pl0-wait
walStorage:
size: 1Gi
storageClass: gtf-ack-essd-pl0-wait
primaryUpdateStrategy: unsupervised
primaryUpdateMethod: switchover
postgresql:
synchronous:
method: any
number: 1
dataDurability: required
backup:
target: prefer-standby
volumeSnapshot:
className: alibabacloud-disk-snapshot
online: false
resources:
requests:
cpu: 100m
memory: 512Mi
limits:
cpu: 500m
memory: 1Gi
https://cloudnative-pg.io/documentation/1.26/cloudnative-pg.v1/#postgresql-cnpg-io-v1-ClusterSpec