From 05605cb956a66e81be979834ac8d2a103570d7ff Mon Sep 17 00:00:00 2001 From: Dieter Maes Date: Tue, 4 Aug 2026 14:30:44 +0200 Subject: [PATCH] feat(cloudnative-pg): allow setting scratch-data emptyDir options closes #979 Signed-off-by: Dieter Maes --- charts/cloudnative-pg/README.md | 1 + charts/cloudnative-pg/templates/deployment.yaml | 5 +++-- charts/cloudnative-pg/values.schema.json | 11 +++++++++++ charts/cloudnative-pg/values.yaml | 4 ++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/charts/cloudnative-pg/README.md b/charts/cloudnative-pg/README.md index 232ff0b653..7793ed1274 100644 --- a/charts/cloudnative-pg/README.md +++ b/charts/cloudnative-pg/README.md @@ -158,6 +158,7 @@ Kubernetes: `>=1.29.0-0` | rbac.create | bool | `true` | Specifies whether ClusterRole and ClusterRoleBinding should be created. | | replicaCount | int | `1` | | | resources | object | `{}` | | +| scratchData.emptyDir | object | `{}` | EmptyDir options for the scratch-data volume. | | service.ipFamilies | list | `[]` | Sets the families that should be supported and the order in which they should be applied to ClusterIP as well. Can be IPv4 and/or IPv6. | | service.ipFamilyPolicy | string | `""` | Set the ip family policy to configure dual-stack see [Configure dual-stack](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) | | service.name | string | `"cnpg-webhook-service"` | The name of the Webhook Service. | diff --git a/charts/cloudnative-pg/templates/deployment.yaml b/charts/cloudnative-pg/templates/deployment.yaml index c17e6a7493..9f4a8ce2a5 100644 --- a/charts/cloudnative-pg/templates/deployment.yaml +++ b/charts/cloudnative-pg/templates/deployment.yaml @@ -166,8 +166,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} volumes: - - emptyDir: {} - name: scratch-data + - name: scratch-data + emptyDir: + {{- toYaml .Values.scratchData.emptyDir | nindent 10 }} - name: webhook-certificates secret: defaultMode: 420 diff --git a/charts/cloudnative-pg/values.schema.json b/charts/cloudnative-pg/values.schema.json index efdd012e85..61d6390512 100644 --- a/charts/cloudnative-pg/values.schema.json +++ b/charts/cloudnative-pg/values.schema.json @@ -325,6 +325,17 @@ "required": [], "type": "object" }, + "scratchData": { + "properties": { + "emptyDir": { + "description": "EmptyDir options for the scratch-data volume.", + "required": [], + "type": "object" + } + }, + "required": [], + "type": "object" + }, "service": { "properties": { "ipFamilies": { diff --git a/charts/cloudnative-pg/values.yaml b/charts/cloudnative-pg/values.yaml index 2fcfd0e999..b9da922fa0 100644 --- a/charts/cloudnative-pg/values.yaml +++ b/charts/cloudnative-pg/values.yaml @@ -167,6 +167,10 @@ resources: {} # cpu: 100m # memory: 100Mi +scratchData: + # -- EmptyDir options for the scratch-data volume. + emptyDir: {} + # -- Nodeselector for the operator to be installed. nodeSelector: {}