Skip to content

Commit 2bf4a44

Browse files
Romain JACQUETrjacquet31
authored andcommitted
feat: add the possibility to inject environment variable in the mongod
pod
1 parent 351095b commit 2bf4a44

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

charts/mongodb-operated/templates/mongdb-community.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ spec:
4242
volumeMounts:
4343
{{- toYaml . | nindent 16 }}
4444
{{- end }}
45+
{{- with .Values.mongodbEnv }}
46+
env:
47+
{{- toYaml . | nindent 16 }}
48+
{{- end }}
4549
- name: mongodb-agent
4650
imagePullPolicy: {{ .Values.image.pullPolicy }}
4751
{{- with .Values.agent.resources }}

charts/mongodb-operated/values.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,15 @@ users:
110110
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#volume-claim-templates
111111

112112
extraVolumeMounts: []
113-
extraVolumeClaimTemplates: []
113+
extraVolumeClaimTemplates: []
114+
115+
# mongodbEnv parameter is a list to specify environment variables
116+
# this is only possible with the mongod container, and not the agent
117+
#
118+
# mongodbEnv:
119+
# - name: MONGO_TEST_USER
120+
# valueFrom:
121+
# secretKeyRef:
122+
# name: mongodb-app-secret
123+
# key: mongodb-user-name
124+
mongodbEnv: {}

0 commit comments

Comments
 (0)