Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cluster): Add replication slots configuration #356

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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 @@ -178,6 +178,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 @@ -35,6 +35,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 @@ -44,6 +44,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 @@ -282,6 +282,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 @@ -201,6 +201,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
Loading