diff --git a/charts/cluster/README.md b/charts/cluster/README.md index 2d57ef6c7..db333211f 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -173,6 +173,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 7c15ded63..715cf0094 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -77,6 +77,10 @@ spec: pg_ident: {{- toYaml . | nindent 6 }} {{- end }} + {{- with .Values.cluster.postgresql.synchronous }} + synchronous: + {{- toYaml . | nindent 6 }} + {{ end }} {{- with .Values.cluster.postgresql.parameters }} parameters: {{- toYaml . | nindent 6 }} 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 604c07d51..b8ff318d5 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 054a5cb4b..68ccba903 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 @@ -62,6 +62,9 @@ cluster: - mymap /^(.*)@mydomain\.com$ \1 shared_preload_libraries: - pgaudit + synchronous: + method: any + number: 1 initdb: database: mydb owner: dante diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 4b6580826..128fb02f7 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -273,6 +273,9 @@ }, "shared_preload_libraries": { "type": "array" + }, + "synchronous": { + "type": "object" } } }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 561e1cf5c..1d650806b 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -262,6 +262,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