diff --git a/stable/postgresql/Chart.yaml b/stable/postgresql/Chart.yaml index 3bf96f9859..1e05beca2c 100644 --- a/stable/postgresql/Chart.yaml +++ b/stable/postgresql/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: postgresql -version: 6.2.1 +version: 6.3.0 appVersion: 11.5.0 description: Chart for PostgreSQL, an object-relational database management system (ORDBMS) with an emphasis on extensibility and on standards-compliance. keywords: diff --git a/stable/postgresql/README.md b/stable/postgresql/README.md index f96c019d9d..d8ba3ca66d 100644 --- a/stable/postgresql/README.md +++ b/stable/postgresql/README.md @@ -54,6 +54,7 @@ The following tables lists the configurable parameters of the PostgreSQL chart a | `global.postgresql.servicePort` | PostgreSQL port (overrides `service.port`) | `nil` | | `global.postgresql.replicationPassword` | Replication user password (overrides `replication.password`) | `nil` | | `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `global.storageClass` | Global storage class for dynamic provisioning | `nil` | | `image.registry` | PostgreSQL Image registry | `docker.io` | | `image.repository` | PostgreSQL Image name | `bitnami/postgresql` | | `image.tag` | PostgreSQL Image tag | `{TAG_NAME}` | diff --git a/stable/postgresql/templates/_helpers.tpl b/stable/postgresql/templates/_helpers.tpl index 2c456f6367..1384a3f320 100644 --- a/stable/postgresql/templates/_helpers.tpl +++ b/stable/postgresql/templates/_helpers.tpl @@ -313,3 +313,23 @@ Get the readiness probe command [ -f /opt/bitnami/postgresql/tmp/.initialized ] {{- end -}} {{- end -}} + +{{/* +Return the proper Storage Class +*/}} +{{- define "postgresql.storageClass" -}} +{{- $storageClass := "" }} +{{- if .Values.persistence.storageClass -}} + {{- $storageClass = .Values.persistence.storageClass -}} +{{- end -}} +{{- if .Values.global -}} + {{- if .Values.global.storageClass -}} + {{- $storageClass = .Values.global.storageClass -}} + {{- end -}} +{{- end -}} +{{- if (eq "-" $storageClass) -}} + {{- printf "\"\"" -}} +{{- else }} + {{- printf "%s" $storageClass -}} +{{- end -}} +{{- end -}} diff --git a/stable/postgresql/templates/statefulset-slaves.yaml b/stable/postgresql/templates/statefulset-slaves.yaml index 33b332a818..fb795f394f 100644 --- a/stable/postgresql/templates/statefulset-slaves.yaml +++ b/stable/postgresql/templates/statefulset-slaves.yaml @@ -232,12 +232,6 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClass }} - {{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" - {{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" - {{- end }} - {{- end }} + storageClassName: {{ include "postgresql.storageClass" . }} {{- end }} {{- end }} diff --git a/stable/postgresql/templates/statefulset.yaml b/stable/postgresql/templates/statefulset.yaml index 9b1c113d22..11b606831e 100644 --- a/stable/postgresql/templates/statefulset.yaml +++ b/stable/postgresql/templates/statefulset.yaml @@ -332,11 +332,5 @@ spec: resources: requests: storage: {{ .Values.persistence.size | quote }} - {{- if .Values.persistence.storageClass }} - {{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" - {{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" - {{- end }} - {{- end }} + storageClassName: {{ include "postgresql.storageClass" . }} {{- end }} diff --git a/stable/postgresql/values-production.yaml b/stable/postgresql/values-production.yaml index 5d761a2a16..1ed6e386be 100644 --- a/stable/postgresql/values-production.yaml +++ b/stable/postgresql/values-production.yaml @@ -7,6 +7,7 @@ global: # imageRegistry: myRegistryName # imagePullSecrets: # - myRegistryKeySecretName +# storageClass: myStorageClass ## Bitnami PostgreSQL image version ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/ diff --git a/stable/postgresql/values.yaml b/stable/postgresql/values.yaml index 2e8f07dd75..29a4154b2e 100644 --- a/stable/postgresql/values.yaml +++ b/stable/postgresql/values.yaml @@ -7,6 +7,7 @@ global: # imageRegistry: myRegistryName # imagePullSecrets: # - myRegistryKeySecretName +# storageClass: myStorageClass ## Bitnami PostgreSQL image version ## ref: https://hub.docker.com/r/bitnami/postgresql/tags/