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 26, 2024
1 parent f0ea226 commit 4cd6453
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
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 @@ -273,6 +273,25 @@
"superuserSecret": {
"type": "string"
},
"replicationSlots": {
"type": "object",
"properties": {
"highAvailability": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"slotPrefix": {
"type": "string"
},
"updateInterval": {
"type": "string"
}
}
}
}
}
"walStorage": {
"type": "object",
"properties": {
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 4cd6453

Please sign in to comment.