[stable/mariadb] Add global StorageClass to mariadb (#16420)

Signed-off-by: Miguel A. Cabrera Minagorri <macabrera@bitnami.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2019-08-20 03:21:33 -07:00
committed by Kubernetes Prow Robot
parent 6e56b90aef
commit 93db6d8ea5
7 changed files with 46 additions and 15 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: mariadb
version: 6.7.4
version: 6.8.0
appVersion: 10.3.17
description: Fast, reliable, scalable, and easy to use open-source relational database system. MariaDB Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software. Highly available MariaDB cluster.
keywords:
+1
View File
@@ -51,6 +51,7 @@ The following table lists the configurable parameters of the MariaDB chart and t
|-------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------|
| `global.imageRegistry` | Global Docker image registry | `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` | MariaDB image registry | `docker.io` |
| `image.repository` | MariaDB Image name | `bitnami/mariadb` |
| `image.tag` | MariaDB Image tag | `{TAG_NAME}` |
+40
View File
@@ -172,3 +172,43 @@ Also, we can't use a single if because lazy evaluation is not an option
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper Storage Class for the master
*/}}
{{- define "mariadb.master.storageClass" -}}
{{- $storageClass := "" }}
{{- if .Values.master.persistence.storageClass -}}
{{- $storageClass = .Values.master.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 -}}
{{/*
Return the proper Storage Class for the slave
*/}}
{{- define "mariadb.slave.storageClass" -}}
{{- $storageClass := "" }}
{{- if .Values.slave.persistence.storageClass -}}
{{- $storageClass = .Values.slave.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 -}}
@@ -261,11 +261,5 @@ spec:
resources:
requests:
storage: {{ .Values.master.persistence.size | quote }}
{{- if .Values.master.persistence.storageClass }}
{{- if (eq "-" .Values.master.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.master.persistence.storageClass | quote }}
{{- end }}
{{- end }}
storageClassName: {{ include "mariadb.master.storageClass" . }}
{{- end }}
@@ -232,13 +232,7 @@ spec:
resources:
requests:
storage: {{ .Values.slave.persistence.size | quote }}
{{- if .Values.slave.persistence.storageClass }}
{{- if (eq "-" .Values.slave.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: {{ .Values.slave.persistence.storageClass | quote }}
{{- end }}
{{- end }}
storageClassName: {{ include "mariadb.slave.storageClass" . }}
{{- else }}
- name: "data"
emptyDir: {}
+1
View File
@@ -6,6 +6,7 @@
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
+1
View File
@@ -6,6 +6,7 @@
# imageRegistry: myRegistryName
# imagePullSecrets:
# - myRegistryKeySecretName
# storageClass: myStorageClass
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/