Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ Kubernetes: `>=1.29.0-0`
| cluster.primaryUpdateMethod | string | `"switchover"` | Method to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated. It can be switchover (default) or restart. |
| cluster.primaryUpdateStrategy | string | `"unsupervised"` | Strategy to follow to upgrade the primary server during a rolling update procedure, after all replicas have been successfully updated: it can be automated (unsupervised - default) or manual (supervised) |
| cluster.priorityClassName | string | `""` | |
| cluster.replicationSlots | object | `{}` | Replication slot management. To make logical decoding slots survive failover for CDC consumers (e.g. Debezium), enable `highAvailability.synchronizeLogicalDecoding`, set `cluster.postgresql.parameters.hot_standby_feedback: "on"` and `cluster.postgresql.parameters.sync_replication_slots: "on"`, and ensure the CDC client creates its logical slot with `failover = true`. Requires CloudNativePG 1.27+ and PostgreSQL 17+ for native failover slots. See: https://cloudnative-pg.io/documentation/current/replication/#replication-slots |
| cluster.resources | object | `{}` | Resources requirements of every generated Pod. Please refer to https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ for more information. We strongly advise you use the same setting for limits and requests so that your cluster pods are given a Guaranteed QoS. See: https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/ |
| cluster.roles | list | `[]` | This feature enables declarative management of existing roles, as well as the creation of new roles if they are not already present in the database. See: https://cloudnative-pg.io/documentation/current/declarative_role_management/ |
| cluster.securityContext | object | `{}` | Configure Container Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ |
Expand Down
5 changes: 5 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ spec:
{{- toYaml . | nindent 6 }}
{{- end }}

{{- with .Values.cluster.replicationSlots }}
replicationSlots:
{{- toYaml . | nindent 4 }}
{{- end }}

{{- if not (and (empty .Values.cluster.roles) (empty .Values.cluster.services)) }}
managed:
{{- with .Values.cluster.services }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ spec:
postgresUID: 1001
postgresGID: 1002
instances: 2
replicationSlots:
highAvailability:
enabled: true
slotPrefix: "_cnpg_"
synchronizeLogicalDecoding: true
updateInterval: 30
postgresql:
ldap:
server: 'openldap.default.svc.cluster.local'
Expand All @@ -23,7 +29,9 @@ spec:
key: 'data'
searchAttribute: 'uid'
parameters:
hot_standby_feedback: "on"
max_connections: "42"
sync_replication_slots: "on"
pg_hba:
- host all 1.2.3.4/32 trust
pg_ident:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ cluster:
inRoles:
- pg_monitor
- pg_signal_backend
replicationSlots:
highAvailability:
enabled: true
slotPrefix: "_cnpg_"
synchronizeLogicalDecoding: true
updateInterval: 30
postgresql:
ldap:
server: 'openldap.default.svc.cluster.local'
Expand All @@ -98,7 +104,9 @@ cluster:
key: 'data'
searchAttribute: 'uid'
parameters:
hot_standby_feedback: "on"
max_connections: "42"
sync_replication_slots: "on"
pg_hba:
- host all 1.2.3.4/32 trust
pg_ident:
Expand Down
33 changes: 33 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,39 @@
"priorityClassName": {
"type": "string"
},
"replicationSlots": {
"type": "object",
"properties": {
"highAvailability": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"slotPrefix": {
"type": "string"
},
"synchronizeLogicalDecoding": {
"type": "boolean"
}
}
},
"synchronizeReplicas": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"excludePatterns": {
"type": "array"
}
}
},
"updateInterval": {
"type": "integer"
}
}
},
"resources": {
"type": "object"
},
Expand Down
14 changes: 14 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,20 @@ cluster:
# key: 'data'
# searchAttribute: 'uid'

# -- Replication slot management. To make logical decoding slots survive
# failover for CDC consumers (e.g. Debezium), enable
# `highAvailability.synchronizeLogicalDecoding`, set
# `cluster.postgresql.parameters.hot_standby_feedback: "on"` and
# `cluster.postgresql.parameters.sync_replication_slots: "on"`, and ensure
# the CDC client creates its logical slot with `failover = true`.
# Requires CloudNativePG 1.27+ and PostgreSQL 17+ for native failover slots.
# See: https://cloudnative-pg.io/documentation/current/replication/#replication-slots
replicationSlots: {}
# highAvailability:
# enabled: true
# slotPrefix: "_cnpg_"
# synchronizeLogicalDecoding: true
# updateInterval: 30

# -- BootstrapInitDB is the configuration of the bootstrap process when initdb is used.
# See: https://cloudnative-pg.io/documentation/current/bootstrap/
Expand Down