[stable/postgresql] Add global StorageClass to postgresql (#16423)

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2019-08-20 05:35:09 -07:00
committed by Kubernetes Prow Robot
parent 4e8c8918be
commit b5ca2eddeb
7 changed files with 26 additions and 15 deletions
+1 -1
View File
@@ -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:
+1
View File
@@ -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}` |
+20
View File
@@ -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 -}}
@@ -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 }}
+1 -7
View File
@@ -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 }}
+1
View File
@@ -7,6 +7,7 @@ global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Bitnami PostgreSQL image version
## ref: https://hub.docker.com/r/bitnami/postgresql/tags/
+1
View File
@@ -7,6 +7,7 @@ global:
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Bitnami PostgreSQL image version
## ref: https://hub.docker.com/r/bitnami/postgresql/tags/