From 372d35452667ad58cb5eac3570f0afe60843500c Mon Sep 17 00:00:00 2001 From: Patrick Pfenning Date: Tue, 17 Sep 2024 10:27:32 +0200 Subject: [PATCH] add synchronous config Signed-off-by: Patrick Pfenning --- charts/cluster/README.md | 1 + charts/cluster/templates/cluster.yaml | 2 ++ .../01-non_default_configuration_cluster-assert.yaml | 3 +++ .../01-non_default_configuration_cluster.yaml | 3 +++ charts/cluster/values.schema.json | 7 +++++++ charts/cluster/values.yaml | 4 ++++ 6 files changed, 20 insertions(+) diff --git a/charts/cluster/README.md b/charts/cluster/README.md index 5b3fcd204..67a2f127b 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -168,6 +168,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 | | cluster.postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 | | cluster.postgresql.parameters | object | `{}` | PostgreSQL configuration options (postgresql.conf) | +| cluster.postgresql.synchronous | object | `{}` | SynchronousReplicaConfiguration. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-SynchronousReplicaConfiguration | | cluster.postgresql.pg_hba | list | `[]` | PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) | | cluster.postgresql.pg_ident | list | `[]` | PostgreSQL User Name Maps rules (lines to be appended to the pg_ident.conf file) | | cluster.postgresql.shared_preload_libraries | list | `[]` | Lists of shared preload libraries to add to the default ones | diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index c1879cfef..87fea2bf7 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -66,6 +66,8 @@ spec: {{- toYaml .pg_hba | nindent 6 }} pg_ident: {{- toYaml .pg_ident | nindent 6 }} + synchronous: + {{- toYaml .synchronous | nindent 6 }} {{ end }} managed: 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 5f5c62a68..1c4774588 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 @@ -21,6 +21,9 @@ spec: - mymap /^(.*)@mydomain\.com$ \1 shared_preload_libraries: - pgaudit + synchronous: + method: any + number: 1 bootstrap: initdb: database: mydb 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 570ea8409..1c6d38b5b 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 @@ -61,6 +61,9 @@ cluster: - mymap /^(.*)@mydomain\.com$ \1 shared_preload_libraries: - pgaudit + syncronous: + method: any + number: 1 initdb: database: mydb owner: dante diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 9e35d7a90..4ee48afe3 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -258,6 +258,13 @@ }, "shared_preload_libraries": { "type": "array" + }, + "synchronous": { + "type": "object", + "properties": { + "method": "string", + "number": "integer" + } } } }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 8398c74d1..c9d0c83ad 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -242,6 +242,10 @@ cluster: # -- PostgreSQL configuration options (postgresql.conf) parameters: {} # max_connections: 300 + # -- Quorum-based Synchronous Replication + synchronous: # {} + # method: any + # number: 1 # -- PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) pg_hba: [] # - host all all 10.244.0.0/16 md5