From 54db2542c7400c7525560fcd2d1cf1f4912c2240 Mon Sep 17 00:00:00 2001 From: Tomas Steiner Date: Mon, 3 Feb 2025 13:17:39 +0100 Subject: [PATCH 1/7] cluster: add projected volume support Signed-off-by: Tomas Steiner --- charts/cluster/templates/cluster.yaml | 6 ++++++ charts/cluster/values.yaml | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index a2cd09853b..cc1d5458b6 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -135,3 +135,9 @@ spec: {{- end }} {{ include "cluster.bootstrap" . | nindent 2 }} {{ include "cluster.backup" . | nindent 2 }} + {{- with .Values.cluster.projectedVolumeTemplate.sources }} + projectedVolumeTemplate: + sources: + {{- . | toYaml | nindent 8 -}} + {{ end }} + diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 991eacd67e..bb167a8579 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -368,6 +368,17 @@ cluster: additionalLabels: {} annotations: {} + # -- mounting custom files inside the Postgres pods through .spec.projectedVolumeTemplate + # See https://cloudnative-pg.io/documentation/current/cluster_conf/#projected-volumes + projectedVolumeTemplate: {} + # sources: + # - secret: + # name: sample-secret + # items: + # - key: tls.crt + # path: certificate/tls.crt + # - key: tls.key + # path: certificate/tls.key backups: # -- You need to configure backups manually, so backups are disabled by default. From 58068660ececda44a312177c6c033d989066c1ab Mon Sep 17 00:00:00 2001 From: Tomas Steiner Date: Mon, 3 Feb 2025 14:20:47 +0100 Subject: [PATCH 2/7] added values.schema.json Signed-off-by: Tomas Steiner --- charts/cluster/values.schema.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 2caa381edd..af3e147a6a 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -294,6 +294,9 @@ "priorityClassName": { "type": "string" }, + "projectedVolumeTemplate": { + "type": "object" + }, "resources": { "type": "object" }, From 8221583e62cf8094e87878a2820dc60e81495ea9 Mon Sep 17 00:00:00 2001 From: Tomas Steiner Date: Tue, 11 Feb 2025 17:13:35 +0100 Subject: [PATCH 3/7] cluster test: add projected volume Signed-off-by: Tomas Steiner --- .../01-non_default_configuration_cluster.yaml | 7 +++++++ 1 file changed, 7 insertions(+) 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 67a38a698d..57ab0e7ce5 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 @@ -106,5 +106,12 @@ cluster: annotations: my-annotation: my-service-account + projectedVolumeTemplate: + sources: + - secret: + name: ca-secret + items: + - key: ca.crt + path: crt/ca-01.pem backups: enabled: false From 7b75da115b1b8e545c1b7449f4bd4045137a030e Mon Sep 17 00:00:00 2001 From: Tomas Steiner Date: Wed, 12 Feb 2025 09:08:15 +0100 Subject: [PATCH 4/7] cluster: values.yaml: fix trailing spaces Signed-off-by: Tomas Steiner --- charts/cluster/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index bb167a8579..0feb806a03 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -368,7 +368,7 @@ cluster: additionalLabels: {} annotations: {} - # -- mounting custom files inside the Postgres pods through .spec.projectedVolumeTemplate + # -- mounting custom files inside the Postgres pods through .spec.projectedVolumeTemplate # See https://cloudnative-pg.io/documentation/current/cluster_conf/#projected-volumes projectedVolumeTemplate: {} # sources: From 10b9f5ea730aca84631c09482ed8a93b9172fec1 Mon Sep 17 00:00:00 2001 From: Tomas Steiner Date: Wed, 7 May 2025 12:43:18 +0200 Subject: [PATCH 5/7] add assert for pojected volume Signed-off-by: Tomas Steiner --- charts/cluster/templates/cluster.yaml | 2 +- .../01-non_default_configuration_cluster-assert.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index cc1d5458b6..60c818f6bf 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -138,6 +138,6 @@ spec: {{- with .Values.cluster.projectedVolumeTemplate.sources }} projectedVolumeTemplate: sources: - {{- . | toYaml | nindent 8 -}} + {{- . | toYaml | nindent 6 -}} {{ end }} 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 e97b431f7a..b722b8a6e8 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 @@ -109,3 +109,11 @@ spec: metadata: annotations: my-annotation: my-service-account + projectedVolumeTemplate: + sources: + - secret: + items: + - key: ca.crt + path: crt/ca-01.pem + name: ca-secret + From 194a81ed0d5e2efe5af7a154ced3bfb5e95f826c Mon Sep 17 00:00:00 2001 From: Philipp Hamann <84906475+pha91@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:22:53 +0200 Subject: [PATCH 6/7] rebase origin Signed-off-by: Philipp Hamann <84906475+pha91@users.noreply.github.com> From 6837dd000d1ea4e2cf6361785c687a49280b0a00 Mon Sep 17 00:00:00 2001 From: Philipp Hamann <84906475+pha91@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:22:53 +0200 Subject: [PATCH 7/7] rebase origin Signed-off-by: Philipp Hamann <84906475+pha91@users.noreply.github.com>