[stable/mongodb-replicaset] Add ServiceAccount option (#22694) (#22697)

Signed-off-by: Krzysztof Miemiec <krzysztof.miemiec@gmail.com>
This commit is contained in:
Krzysztof Miemiec
2020-06-19 14:16:10 -07:00
committed by GitHub
parent f73a24c6bc
commit e9d85afa10
5 changed files with 24 additions and 3 deletions
+1 -1
View File
@@ -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.
+3 -2
View File
@@ -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` |
@@ -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 -}}
@@ -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 }}"
+2
View File
@@ -77,6 +77,8 @@ metrics:
enabled: true
runAsUser: 1001
serviceAccount: ""
# Annotations to be added to MongoDB pods
podAnnotations: {}