diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 771022455..07a5bd1ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,7 +23,7 @@ jobs: with: version: v3.4.0 - - uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: python-version: 3.7 diff --git a/charts/cluster/Chart.yaml b/charts/cluster/Chart.yaml index 51b6e824c..d18c91d03 100644 --- a/charts/cluster/Chart.yaml +++ b/charts/cluster/Chart.yaml @@ -18,7 +18,7 @@ name: cluster description: Deploys and manages a CloudNativePG cluster and its associated resources. icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg type: application -version: 0.0.10 +version: 0.0.11 sources: - https://github.com/cloudnative-pg/charts keywords: diff --git a/charts/cluster/README.md b/charts/cluster/README.md index b82df5837..b14cba9a1 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -1,6 +1,6 @@ # cluster -![Version: 0.0.10](https://img.shields.io/badge/Version-0.0.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.0.11](https://img.shields.io/badge/Version-0.0.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) > **Warning** > ### This chart is under active development. @@ -177,7 +177,8 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.monitoring.prometheusRule.excludeRules | list | `[]` | Exclude specified rules | | cluster.postgresGID | int | `26` | The GID of the postgres user inside the image, defaults to 26 | | cluster.postgresUID | int | `26` | The UID of the postgres user inside the image, defaults to 26 | -| cluster.postgresql | object | `{}` | Configuration of the PostgreSQL server. See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration | +| cluster.postgresql.parameters | object | `{}` | PostgreSQL configuration options (postgresql.conf) | +| cluster.postgresql.pg_hba | list | `[]` | PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) | | 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 | `""` | | @@ -187,6 +188,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentat | cluster.storage.size | string | `"8Gi"` | | | cluster.storage.storageClass | string | `""` | | | cluster.superuserSecret | string | `""` | | +| cluster.walStorage.enabled | bool | `false` | | | cluster.walStorage.size | string | `"1Gi"` | | | cluster.walStorage.storageClass | string | `""` | | | fullnameOverride | string | `""` | Override the full name of the chart | diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 5500ebb0e..9a4b0254a 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -24,7 +24,7 @@ spec: storage: size: {{ .Values.cluster.storage.size }} storageClass: {{ .Values.cluster.storage.storageClass }} -{{- if .Values.cluster.walStorage }} +{{- if .Values.cluster.walStorage.enabled }} walStorage: size: {{ .Values.cluster.walStorage.size }} storageClass: {{ .Values.cluster.walStorage.storageClass }} @@ -65,8 +65,10 @@ spec: {{- end }} {{- with .Values.cluster.postgresql }} parameters: - {{- toYaml . | nindent 6 }} - {{- end }} + {{- toYaml .parameters | nindent 6 }} + pg_hba: + {{- toYaml .pg_hba | nindent 6 }} + {{ end }} {{- with .Values.cluster.roles }} 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 7a8a7eb8b..5662a1d2e 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 @@ -15,6 +15,8 @@ spec: postgresql: parameters: max_connections: "42" + pg_hba: + - host all 1.2.3.4/32 trust 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 023e8b9d2..427d81ef8 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 @@ -10,6 +10,7 @@ cluster: size: 256Mi storageClass: standard walStorage: + enabled: true size: 256Mi storageClass: standard postgresUID: 1001 @@ -57,7 +58,10 @@ cluster: - pg_monitor - pg_signal_backend postgresql: - max_connections: "42" + parameters: + max_connections: "42" + pg_hba: + - host all 1.2.3.4/32 trust initdb: database: mydb owner: dante diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index b39148376..67da0b2b4 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -289,7 +289,15 @@ "type": "integer" }, "postgresql": { - "type": "object" + "type": "object", + "properties": { + "parameters": { + "type": "object" + }, + "pg_hba": { + "type": "array" + } + } }, "primaryUpdateMethod": { "type": "string" @@ -342,6 +350,9 @@ "walStorage": { "type": "object", "properties": { + "enabled": { + "type": "boolean" + }, "size": { "type": "string" }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 36e21e902..0bf6bfb3d 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -39,6 +39,7 @@ cluster: storageClass: "" walStorage: + enabled: false size: 1Gi storageClass: "" @@ -160,10 +161,13 @@ cluster: # - name: custom-queries-secret # key: custom-queries - # -- Configuration of the PostgreSQL server. - # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-PostgresConfiguration - postgresql: {} - # max_connections: 300 + postgresql: + # -- PostgreSQL configuration options (postgresql.conf) + parameters: {} + # max_connections: 300 + # -- 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 # -- BootstrapInitDB is the configuration of the bootstrap process when initdb is used. # See: https://cloudnative-pg.io/documentation/current/bootstrap/