diff --git a/stable/mongodb-replicaset/Chart.yaml b/stable/mongodb-replicaset/Chart.yaml index e78e410c46..523c4ef2f6 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.15.1 +version: 3.16.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 222df763ca..192d095e17 100644 --- a/stable/mongodb-replicaset/README.md +++ b/stable/mongodb-replicaset/README.md @@ -36,9 +36,9 @@ The following table lists the configurable parameters of the mongodb chart and t | ----------------------------------- | ------------------------------------------------------------------------- | --------------------------------------------------- | | `replicas` | Number of replicas in the replica set | `3` | | `replicaSetName` | The name of the replica set | `rs0` | -| `skipInitialization` | If `true` skip replica set initialization during bootstrapping | `false` +| `skipInitialization` | If `true` skip replica set initialization during bootstrapping | `false` | | `podDisruptionBudget` | Pod disruption budget | `{}` | -| `updateStrategy` | Update strategy | `nil` | +| `updateStrategy` | Update strategy | `nil` | | `port` | MongoDB port | `27017` | | `imagePullSecrets` | Image pull secrets | `[]` | | `installImage.repository` | Image name for the install container | `unguiculus/mongodb-install` | @@ -50,6 +50,7 @@ The following table lists the configurable parameters of the mongodb chart and t | `image.repository` | MongoDB image name | `mongo` | | `image.tag` | MongoDB image tag | `3.6` | | `image.pullPolicy` | MongoDB image pull policy | `IfNotPresent` | +| `serviceAccount` | Name of a ServiceAccount to be created and applied to StatefulSet pods. Won't be created by default. | `` | | `podAnnotations` | Annotations to be added to MongoDB pods | `{}` | | `statefulSetAnnotations` | Annotations to be added to MongoDB statefulSet | `{}` | | `securityContext.enabled` | Enable security context | `true` | diff --git a/stable/mongodb-replicaset/templates/mongodb-serviceaccount.yaml b/stable/mongodb-replicaset/templates/mongodb-serviceaccount.yaml new file mode 100644 index 0000000000..1866132f1c --- /dev/null +++ b/stable/mongodb-replicaset/templates/mongodb-serviceaccount.yaml @@ -0,0 +1,15 @@ +{{- if .Values.serviceAccount -}} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount }} + namespace: {{ template "mongodb-replicaset.namespace" . }} + labels: + app: {{ template "mongodb-replicaset.name" . }} + chart: {{ template "mongodb-replicaset.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + {{- if .Values.extraLabels }} + {{ toYaml .Values.extraLabels | indent 4 }} + {{- end }} +{{- end -}} diff --git a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml index 9afeda09fb..e65114db93 100644 --- a/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml +++ b/stable/mongodb-replicaset/templates/mongodb-statefulset.yaml @@ -61,6 +61,9 @@ spec: runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }} {{- end }} terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} + {{- if .Values.serviceAccount }} + serviceAccountName: {{ .Values.serviceAccount }} + {{- end }} initContainers: - name: copy-config image: "{{ .Values.copyConfigImage.repository }}:{{ .Values.copyConfigImage.tag }}" diff --git a/stable/mongodb-replicaset/values.yaml b/stable/mongodb-replicaset/values.yaml index c9b87996c7..b80f4d6de2 100644 --- a/stable/mongodb-replicaset/values.yaml +++ b/stable/mongodb-replicaset/values.yaml @@ -77,6 +77,8 @@ metrics: enabled: true runAsUser: 1001 +serviceAccount: "" + # Annotations to be added to MongoDB pods podAnnotations: {}