From b884cf07d320446e4874ae0a10dca378c3257466 Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 9 Dec 2017 13:25:39 +0100 Subject: [PATCH] [stable/mongodb] Random passwords for mongodb if they are not set in values.yaml (#2850) * random passwords for mongodb if not set * increase Chart version to 0.4.19 * README.md adjusted * version 0.4.19 to 0.4.20 --- stable/mongodb/Chart.yaml | 2 +- stable/mongodb/README.md | 4 ++-- stable/mongodb/templates/secrets.yaml | 12 ++++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/stable/mongodb/Chart.yaml b/stable/mongodb/Chart.yaml index f4b7eba3b3..6309ad9594 100644 --- a/stable/mongodb/Chart.yaml +++ b/stable/mongodb/Chart.yaml @@ -1,5 +1,5 @@ name: mongodb -version: 0.4.19 +version: 0.4.20 appVersion: 3.6.0 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. keywords: diff --git a/stable/mongodb/README.md b/stable/mongodb/README.md index bac5168a36..82fb2f3ee2 100644 --- a/stable/mongodb/README.md +++ b/stable/mongodb/README.md @@ -47,9 +47,9 @@ The following tables lists the configurable parameters of the MongoDB chart and |----------------------------|-------------------------------------|----------------------------------------------------------| | `image` | MongoDB image | `bitnami/mongodb:{VERSION}` | | `imagePullPolicy` | Image pull policy | `Always` if `imageTag` is `latest`, else `IfNotPresent`. | -| `mongodbRootPassword` | MongoDB admin password | `nil` | +| `mongodbRootPassword` | MongoDB admin password | `random alhpanumeric string (10)` | | `mongodbUsername` | MongoDB custom user | `nil` | -| `mongodbPassword` | MongoDB custom user password | `nil` | +| `mongodbPassword` | MongoDB custom user password | `random alhpanumeric string (10)` | | `mongodbDatabase` | Database to create | `nil` | | `serviceType` | Kubernetes Service type | `ClusterIP` | | `persistence.enabled` | Use a PVC to persist data | `true` | diff --git a/stable/mongodb/templates/secrets.yaml b/stable/mongodb/templates/secrets.yaml index d95e7a451c..7d2d4047bf 100644 --- a/stable/mongodb/templates/secrets.yaml +++ b/stable/mongodb/templates/secrets.yaml @@ -9,5 +9,13 @@ metadata: heritage: "{{ .Release.Service }}" type: Opaque data: - mongodb-root-password: {{ default "" .Values.mongodbRootPassword | b64enc | quote }} - mongodb-password: {{ default "" .Values.mongodbPassword | b64enc | quote }} + {{ if .Values.mongodbRootPassword }} + mongodb-root-password: {{ .Values.mongodbRootPassword | b64enc | quote }} + {{ else }} + mongodb-root-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} + {{ if .Values.mongodbPassword }} + mongodb-password: {{ .Values.mongodbPassword | b64enc | quote }} + {{ else }} + mongodb-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} \ No newline at end of file