@@ -137,11 +137,16 @@ spec:
137
137
optional : {{ include "common.tplvalues.render" (dict "value" .Values.grafana.extraEnvVarsSecretOptional "context" $) }}
138
138
{{- end }}
139
139
env :
140
+ {{- if .Values.usePasswordFiles }}
141
+ - name : GF_SECURITY_ADMIN_PASSWORD_FILE
142
+ value : {{ printf "/opt/bitnami/grafana/secrets/%s" (include "grafana.adminSecretPasswordKey" .) }}
143
+ {{- else }}
140
144
- name : GF_SECURITY_ADMIN_PASSWORD
141
145
valueFrom :
142
146
secretKeyRef :
143
147
name : {{ include "grafana.adminSecretName" . }}
144
148
key : {{ include "grafana.adminSecretPasswordKey" . }}
149
+ {{- end }}
145
150
{{- if .Values.smtp.enabled }}
146
151
- name : GF_SMTP_ENABLED
147
152
value : " true"
@@ -161,6 +166,12 @@ spec:
161
166
- name : GF_SMTP_SKIP_VERIFY
162
167
value : " {{ .Values.smtp.skipVerify }}"
163
168
{{- end }}
169
+ {{- if .Values.usePasswordFiles }}
170
+ - name : GF_SMTP_USER_FILE
171
+ value : {{ printf "/opt/bitnami/grafana/secrets/%s" (include "grafana.smtpSecretUserKey" .) }}
172
+ - name : GF_SMTP_PASSWORD_FILE
173
+ value : {{ printf "/opt/bitnami/grafana/secrets/%s" (include "grafana.smtpSecretPasswordKey" .) }}
174
+ {{- else }}
164
175
- name : GF_SMTP_USER
165
176
valueFrom :
166
177
secretKeyRef :
@@ -172,6 +183,7 @@ spec:
172
183
name : {{ include "grafana.smtpSecretName" . }}
173
184
key : {{ include "grafana.smtpSecretPasswordKey" . }}
174
185
{{- end }}
186
+ {{- end }}
175
187
{{- if .Values.grafana.extraEnvVars }}
176
188
{{- include "common.tplvalues.render" (dict "value" .Values.grafana.extraEnvVars "context" $) | nindent 12 }}
177
189
{{- end }}
@@ -188,6 +200,10 @@ spec:
188
200
- name : empty-dir
189
201
mountPath : /bitnami/grafana
190
202
subPath : app-volume-dir
203
+ {{- if and .Values.usePasswordFiles }}
204
+ - name : grafana-secrets
205
+ mountPath : /opt/bitnami/grafana/secrets
206
+ {{- end }}
191
207
{{- if .Values.config.useGrafanaIniFile }}
192
208
- name : grafana-ini
193
209
mountPath : /opt/bitnami/grafana/conf/grafana.ini
@@ -299,6 +315,17 @@ spec:
299
315
volumes :
300
316
- name : empty-dir
301
317
emptyDir : {}
318
+ {{- if and .Values.usePasswordFiles }}
319
+ - name : grafana-secrets
320
+ projected :
321
+ sources :
322
+ - secret :
323
+ name : {{ include "grafana.adminSecretName" . }}
324
+ {{- if .Values.smtp.enabled }}
325
+ - secret :
326
+ name : {{ include "grafana.smtpSecretName" . }}
327
+ {{- end }}
328
+ {{- end }}
302
329
- name : data
303
330
{{- if .Values.persistence.enabled }}
304
331
persistentVolumeClaim :
0 commit comments