Skip to content

Commit

Permalink
feat(cluster): Add replication slots configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitriy Alekseev <[email protected]>
  • Loading branch information
dragoangel committed Aug 31, 2024
1 parent f0ea226 commit e88e0af
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat
| 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 | `{"highAvailability":{"enabled":true,"slotPrefix":"_cnpg_"},"updateInterval":30}` | This feature automatically manages physical replication slots for each hot standby replica in the High Availability cluster, both in the primary and the standby. See: https://cloudnative-pg.io/documentation/current/replication/#replication-slots-for-high-availability |
| 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.storage.size | string | `"8Gi"` | |
Expand Down
4 changes: 4 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ spec:
superuserSecret:
name: {{ . }}
{{ end }}
{{- with .Values.cluster.replicationSlots }}
replicationSlots:
{{- toYaml . | nindent 4 }}
{{ end }}
postgresql:
shared_preload_libraries:
{{- if eq .Values.type "timescaledb" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ spec:
- CREATE TABLE mytable (id serial PRIMARY KEY, name VARCHAR(255));
superuserSecret:
name: supersecret-secret
replicationSlots:
highAvailability:
enabled: false
slotPrefix: _cnpg_cust_
updateInterval: "60"
enableSuperuserAccess: true
certificates:
serverCASecret: ca-secret
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ cluster:
clientCASecret: client-ca-secret
enableSuperuserAccess: true
superuserSecret: supersecret-secret
replicationSlots:
highAvailability:
enabled: false
slotPrefix: _cnpg_cust_
updateInterval: "60"
roles:
- name: dante
ensure: present
Expand Down
19 changes: 19 additions & 0 deletions charts/cluster/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,25 @@
"priorityClassName": {
"type": "string"
},
"replicationSlots": {
"type": "object",
"properties": {
"highAvailability": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"slotPrefix": {
"type": "string"
}
}
},
"updateInterval": {
"type": "integer"
}
}
},
"resources": {
"type": "object"
},
Expand Down
9 changes: 9 additions & 0 deletions charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ cluster:
enableSuperuserAccess: true
superuserSecret: ""

# -- This feature automatically manages physical replication slots for each hot standby replica in
# the High Availability cluster, both in the primary and the standby.
# See: https://cloudnative-pg.io/documentation/current/replication/#replication-slots-for-high-availability
replicationSlots:
highAvailability:
enabled: true
slotPrefix: _cnpg_
updateInterval: 30

# -- 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/
Expand Down

0 comments on commit e88e0af

Please sign in to comment.