diff --git a/charts/cluster/README.md b/charts/cluster/README.md index b3d37062ad..cbb3324135 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -202,6 +202,7 @@ Kubernetes: `>=1.29.0-0` | cluster.enableSuperuserAccess | bool | `true` | When this option is enabled, the operator will use the SuperuserSecret to update the postgres user password. If the secret is not present, the operator will automatically create one. When this option is disabled, the operator will ignore the SuperuserSecret content, delete it when automatically created, and then blank the password of the postgres user by setting it to NULL. | | cluster.env | list | `[]` | Env follows the Env format to pass environment variables to the pods created in the cluster | | cluster.envFrom | list | `[]` | EnvFrom follows the EnvFrom format to pass environment variables sources to the pods to be used by Env | +| cluster.ephemeralVolumeSource | object | `{}` | Override the default emptyDir used by CNPG for temporary storage. See: https://cloudnative-pg.io/documentation/current/cluster_conf/#ephemeral-volumes | | cluster.imageCatalogRef | object | `{}` | Reference to `ImageCatalog` of `ClusterImageCatalog`, if specified takes precedence over `cluster.imageName` | | cluster.imageName | string | `""` | Name of the container image, supporting both tags (:) and digests for deterministic and repeatable deployments: :@sha256: | | cluster.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy. One of Always, Never or IfNotPresent. If not defined, it defaults to IfNotPresent. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images | diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index ecf04b6de2..b090c94e99 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -31,6 +31,10 @@ spec: storageClass: {{ .Values.cluster.walStorage.storageClass }} {{- end }} {{- end }} + {{- with .Values.cluster.ephemeralVolumeSource }} + ephemeralVolumeSource: + {{- toYaml . | nindent 4 }} + {{- end }} {{- with .Values.cluster.resources }} resources: {{- toYaml . | nindent 4 }} 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 9d899a0237..6877877ab1 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 @@ -70,6 +70,15 @@ spec: walStorage: size: 256Mi storageClass: standard + ephemeralVolumeSource: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + storageClassName: scratch-storage-class + resources: + requests: + storage: 1Gi affinity: topologyKey: kubernetes.io/hostname nodeAffinity: 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 13805d3335..c08b2689df 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 @@ -13,6 +13,15 @@ cluster: enabled: true size: 256Mi storageClass: standard + ephemeralVolumeSource: + volumeClaimTemplate: + spec: + accessModes: + - ReadWriteOnce + storageClassName: scratch-storage-class + resources: + requests: + storage: 1Gi postgresUID: 1001 postgresGID: 1002 resources: diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index cf581a8577..1444635279 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -318,6 +318,11 @@ }, "type": "array" }, + "ephemeralVolumeSource": { + "description": "Override the default emptyDir used by CNPG for temporary storage.\nSee: https://cloudnative-pg.io/documentation/current/cluster_conf/#ephemeral-volumes", + "required": [], + "type": "object" + }, "imageCatalogRef": { "description": "Reference to `ImageCatalog` of `ClusterImageCatalog`, if specified takes precedence over `cluster.imageName`", "required": [], diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index a85aa39f9b..e6cdfeb629 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -222,6 +222,17 @@ cluster: size: 1Gi storageClass: "" + # -- Override the default emptyDir used by CNPG for temporary storage. + # See: https://cloudnative-pg.io/documentation/current/cluster_conf/#ephemeral-volumes + ephemeralVolumeSource: {} + # volumeClaimTemplate: + # spec: + # accessModes: ["ReadWriteOnce"] + # storageClassName: "scratch-storage-class" + # resources: + # requests: + # storage: 1Gi + # -- The UID of the postgres user inside the image, defaults to 26 postgresUID: -1