@@ -156,11 +156,16 @@ spec:
156
156
value : {{ include "ghost.databaseName" . | quote }}
157
157
- name : GHOST_DATABASE_USER
158
158
value : {{ include "ghost.databaseUser" . | quote }}
159
+ {{- if .Values.usePasswordFiles }}
160
+ - name : GHOST_DATABASE_PASSWORD_FILE
161
+ value : " /opt/bitnami/ghost/secrets/mysql-password"
162
+ {{- else }}
159
163
- name : GHOST_DATABASE_PASSWORD
160
164
valueFrom :
161
165
secretKeyRef :
162
166
name : {{ include "ghost.databaseSecretName" . }}
163
167
key : mysql-password
168
+ {{- end -}}
164
169
{{- if (and (not .Values.mysql.enabled) .Values.externalDatabase.ssl) }}
165
170
- name : GHOST_DATABASE_ENABLE_SSL
166
171
value : {{ .Values.externalDatabase.ssl | quote }}
@@ -175,11 +180,16 @@ spec:
175
180
value : {{ ternary .Values.containerPorts.https .Values.containerPorts.http .Values.ghostEnableHttps | quote }}
176
181
- name : GHOST_USERNAME
177
182
value : {{ .Values.ghostUsername | quote }}
183
+ {{- if .Values.usePasswordFiles }}
184
+ - name : GHOST_PASSWORD_FILE
185
+ value : {{ printf "/opt/bitnami/ghost/secrets/%s" (include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "ghost-password")) }}
186
+ {{- else }}
178
187
- name : GHOST_PASSWORD
179
188
valueFrom :
180
189
secretKeyRef :
181
190
name : {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
182
191
key : {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "ghost-password") }}
192
+ {{- end }}
183
193
- name : GHOST_EMAIL
184
194
value : {{ .Values.ghostEmail | quote }}
185
195
- name : GHOST_BLOG_TITLE
@@ -205,12 +215,17 @@ spec:
205
215
value : {{ .Values.smtpUser | quote }}
206
216
{{- end }}
207
217
{{- if .Values.smtpPassword }}
218
+ {{- if .Values.usePasswordFiles }}
219
+ - name : GHOST_SMTP_PASSWORD_FILE
220
+ value : {{ printf "/opt/bitnami/ghost/secrets/%s" (include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "smtp-password")) }}
221
+ {{- else }}
208
222
- name : GHOST_SMTP_PASSWORD
209
223
valueFrom :
210
224
secretKeyRef :
211
225
name : {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
212
226
key : {{ include "common.secrets.key" (dict "existingSecret" .Values.existingSecret "key" "smtp-password") }}
213
227
{{- end }}
228
+ {{- end }}
214
229
{{- if .Values.smtpService }}
215
230
- name : GHOST_SMTP_SERVICE
216
231
value : {{ .Values.smtpService | quote }}
@@ -312,6 +327,10 @@ spec:
312
327
subPath : tmp-dir
313
328
- name : ghost-data
314
329
mountPath : /bitnami/ghost
330
+ {{- if and .Values.usePasswordFiles }}
331
+ - name : ghost-secrets
332
+ mountPath : /opt/bitnami/ghost/secrets
333
+ {{- end }}
315
334
{{- if .Values.persistence.subPath }}
316
335
subPath : {{ .Values.persistence.subPath }}
317
336
{{- end }}
@@ -324,6 +343,19 @@ spec:
324
343
volumes :
325
344
- name : empty-dir
326
345
emptyDir : {}
346
+ {{- if and .Values.usePasswordFiles }}
347
+ - name : ghost-secrets
348
+ projected :
349
+ sources :
350
+ - secret :
351
+ name : {{ include "ghost.databaseSecretName" . }}
352
+ - secret :
353
+ name : {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
354
+ {{- if .Values.smtpPassword }}
355
+ - secret :
356
+ name : {{ include "common.secrets.name" (dict "existingSecret" .Values.existingSecret "context" $) }}
357
+ {{- end }}
358
+ {{- end }}
327
359
- name : ghost-data
328
360
{{- if .Values.persistence.enabled }}
329
361
persistentVolumeClaim :
0 commit comments