From 97cb5790cd034c6451113dc475629f9600e346cf Mon Sep 17 00:00:00 2001 From: Oluwaseun Obajobi Date: Wed, 4 Mar 2020 19:35:47 +0400 Subject: [PATCH] [stable/mongodb-replicaset] feature: add support for extra containers and volumes (#20875) * add support for extra containers and volumes Signed-off-by: Oluwaseun Obajobi * fix: updated the pull request with recommended changes Signed-off-by: Oluwaseun Obajobi * update the chart version to `3.12.0` Signed-off-by: Oluwaseun Obajobi --- stable/mongodb-replicaset/Chart.yaml | 2 +- stable/mongodb-replicaset/README.md | 2 ++ .../templates/mongodb-statefulset.yaml | 6 ++++++ stable/mongodb-replicaset/values.yaml | 20 +++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/stable/mongodb-replicaset/Chart.yaml b/stable/mongodb-replicaset/Chart.yaml index 81cba1d041..7d44ae2033 100644 --- a/stable/mongodb-replicaset/Chart.yaml +++ b/stable/mongodb-replicaset/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: mongodb-replicaset home: https://github.com/mongodb/mongo -version: 3.11.6 +version: 3.12.0 appVersion: 3.6 description: NoSQL document-oriented database that stores JSON-like documents with dynamic schemas, simplifying the integration of data in content-driven applications. diff --git a/stable/mongodb-replicaset/README.md b/stable/mongodb-replicaset/README.md index 3b09202b33..8d0e3a7386 100644 --- a/stable/mongodb-replicaset/README.md +++ b/stable/mongodb-replicaset/README.md @@ -107,8 +107,10 @@ The following table lists the configurable parameters of the mongodb chart and t | `readinessProbe.periodSeconds` | Readiness probe period seconds | `10` | | `readinessProbe.successThreshold` | Readiness probe success threshold | `1` | | `readinessProbe.timeoutSeconds` | Readiness probe timeout seconds | `1` | +| `extraContainers` | Additional containers to add to the StatefulSet | `[]` | | `extraVars` | Set environment variables for the main container | `{}` | | `extraLabels` | Additional labels to add to resources | `{}` | +| `extraVolumes` | Additional volumes to add to the resources | `[]` | *MongoDB config file* diff --git a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml index f7367412fc..430599b201 100644 --- a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml +++ b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml @@ -293,6 +293,9 @@ spec: initialDelaySeconds: 30 periodSeconds: 10 {{ end }} + {{- if .Values.extraContainers }} + {{- tpl (toYaml .Values.extraContainers) . | nindent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -329,6 +332,9 @@ spec: emptyDir: {} - name: configdir emptyDir: {} +{{- if .Values.extraVolumes }} +{{- tpl (toYaml .Values.extraVolumes) . | nindent 8 }} +{{- end }} {{- if .Values.persistentVolume.enabled }} volumeClaimTemplates: - metadata: diff --git a/stable/mongodb-replicaset/values.yaml b/stable/mongodb-replicaset/values.yaml index 8e2b671579..567b4f71bf 100644 --- a/stable/mongodb-replicaset/values.yaml +++ b/stable/mongodb-replicaset/values.yaml @@ -101,8 +101,28 @@ affinity: {} tolerations: [] +# Additional containers to add to the StatefulSet +extraContainers: [] +# - name: mongo-sidecar +# image: stefanprodan/mgob:latest +# ports: +# - name: sidecar-http +# containerPort: 8090 +# volumeMounts: +# - mountPath: /config/test1.yml +# name: mgob-config +# subPath: test1.yml +# - name: mgob-storage +# mountPath: /storage + extraLabels: {} +## Additional volumes which can be used by sidecar containers +extraVolumes: [] +# - name: mgob-config +# configMap: +# name: mgob-config + priorityClassName: "" persistentVolume: