From 086347f1e9ec617696a8e6e71f1fb6400f3d73ab Mon Sep 17 00:00:00 2001 From: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> Date: Mon, 26 Aug 2024 12:17:59 +0200 Subject: [PATCH] feat(cluster): Add replication slots configuration Signed-off-by: Dmitriy Alekseev <1865999+dragoangel@users.noreply.github.com> --- charts/cluster/templates/cluster.yaml | 4 ++++ charts/cluster/values.schema.json | 19 +++++++++++++++++++ charts/cluster/values.yaml | 9 +++++++++ 3 files changed, 32 insertions(+) diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 2dace8e34..22cc073fa 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -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" }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index a2354a8f8..850449a31 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -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": { diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 7aa766d0f..687e93f47 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -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/