diff --git a/stable/mongodb/Chart.yaml b/stable/mongodb/Chart.yaml index 5341002568..a1f9a72fc7 100644 --- a/stable/mongodb/Chart.yaml +++ b/stable/mongodb/Chart.yaml @@ -1,5 +1,5 @@ name: mongodb -version: 0.4.4 +version: 0.4.5 description: Chart for MongoDB keywords: - mongodb diff --git a/stable/mongodb/README.md b/stable/mongodb/README.md index 4fbbcfdf1d..8de6c0baf4 100644 --- a/stable/mongodb/README.md +++ b/stable/mongodb/README.md @@ -52,7 +52,7 @@ The following tables lists the configurable parameters of the MongoDB chart and | `mongodbPassword` | MongoDB custom user password | `nil` | | `mongodbDatabase` | Database to create | `nil` | | `persistence.enabled` | Use a PVC to persist data | `true` | -| `persistence.storageClass` | Storage class of backing PVC | `generic` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `8Gi` | diff --git a/stable/mongodb/templates/_helpers.tpl b/stable/mongodb/templates/_helpers.tpl index 234480de71..f0d83d2edb 100644 --- a/stable/mongodb/templates/_helpers.tpl +++ b/stable/mongodb/templates/_helpers.tpl @@ -3,14 +3,14 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/stable/mongodb/templates/pvc.yaml b/stable/mongodb/templates/pvc.yaml index db19bb97d9..321f464a66 100644 --- a/stable/mongodb/templates/pvc.yaml +++ b/stable/mongodb/templates/pvc.yaml @@ -4,7 +4,11 @@ apiVersion: v1 metadata: name: {{ template "fullname" . }} annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- if .Values.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} diff --git a/stable/mongodb/values.yaml b/stable/mongodb/values.yaml index 5ffeb47eff..27f1357c5d 100644 --- a/stable/mongodb/values.yaml +++ b/stable/mongodb/values.yaml @@ -26,7 +26,10 @@ image: bitnami/mongodb:3.4.1-r2 ## persistence: enabled: true - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi