From 78a21aea77dff0187e7f9535488d68c2e61f7314 Mon Sep 17 00:00:00 2001 From: mbugeia Date: Sat, 7 Dec 2024 16:59:06 +0100 Subject: [PATCH] feat(cluster): added support for enablePDB option (#431) Signed-off-by: Maxime Bugeia Co-authored-by: Itay Grudev --- charts/cluster/templates/cluster.yaml | 3 ++- .../01-non_default_configuration_cluster-assert.yaml | 1 + .../01-non_default_configuration_cluster.yaml | 1 + charts/cluster/values.yaml | 4 ++++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 2630c5447..e60bfddf5 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -28,7 +28,7 @@ spec: walStorage: size: {{ .Values.cluster.walStorage.size }} storageClass: {{ .Values.cluster.walStorage.storageClass }} -{{- end }} +{{- end }} {{- with .Values.cluster.resources }} resources: {{- toYaml . | nindent 4 }} @@ -56,6 +56,7 @@ spec: superuserSecret: name: {{ . }} {{ end }} + enablePDB: {{ .Values.cluster.enablePDB }} postgresql: shared_preload_libraries: {{- if eq .Values.type "timescaledb" }} diff --git a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml index 98e5f70fa..604c07d51 100644 --- a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml +++ b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml @@ -36,6 +36,7 @@ spec: superuserSecret: name: supersecret-secret enableSuperuserAccess: true + enablePDB: false certificates: serverCASecret: ca-secret serverTLSSecret: tls-secret diff --git a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml index 58c24b059..054a5cb4b 100644 --- a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml +++ b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml @@ -44,6 +44,7 @@ cluster: clientCASecret: client-ca-secret enableSuperuserAccess: true superuserSecret: supersecret-secret + enablePDB: false roles: - name: dante ensure: present diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 92778a398..fccfe0723 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -206,6 +206,10 @@ cluster: enableSuperuserAccess: true superuserSecret: "" + # -- Allow to disable PDB, mainly useful for upgrade of single-instance clusters or development purposes + # See: https://cloudnative-pg.io/documentation/current/kubernetes_upgrade/#pod-disruption-budgets + enablePDB: true + # -- 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/