@@ -83,31 +83,52 @@ spec:
83
83
env :
84
84
- name : BITNAMI_DEBUG
85
85
value : {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
86
+ {{- if .Values.usePasswordFiles }}
87
+ - name : MASTODON_DATABASE_PASSWORD_FILE
88
+ value : " /opt/bitnami/mastodon/secrets/db-password"
89
+ {{- else }}
86
90
- name : MASTODON_DATABASE_PASSWORD
87
91
valueFrom :
88
92
secretKeyRef :
89
93
name : {{ include "mastodon.database.secretName" . }}
90
94
key : {{ include "mastodon.database.passwordKey" . | quote }}
95
+ {{- end }}
91
96
{{- if (include "mastodon.redis.auth.enabled" .) }}
92
97
# The rake db:migrate job requires access to Redis
98
+ {{- if .Values.usePasswordFiles }}
99
+ - name : MASTODON_REDIS_PASSWORD_FILE
100
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.redis.passwordKey" .) }}
101
+ {{- else }}
93
102
- name : MASTODON_REDIS_PASSWORD
94
103
valueFrom :
95
104
secretKeyRef :
96
105
name : {{ include "mastodon.redis.secretName" . }}
97
106
key : {{ include "mastodon.redis.passwordKey" . | quote }}
98
107
{{- end }}
108
+ {{- end }}
99
109
{{- if (include "mastodon.elasticsearch.auth.enabled" .) }}
110
+ {{- if .Values.usePasswordFiles }}
111
+ - name : MASTODON_ELASTICSEARCH_PASSWORD_FILE
112
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.elasticsearch.passwordKey" .) }}
113
+ {{- else }}
100
114
- name : MASTODON_ELASTICSEARCH_PASSWORD
101
115
valueFrom :
102
116
secretKeyRef :
103
117
name : {{ include "mastodon.elasticsearch.secretName" . }}
104
118
key : {{ include "mastodon.elasticsearch.passwordKey" . | quote }}
105
119
{{- end }}
120
+ {{- end }}
106
121
{{- if and .Values.initJob.precompileAssets.enabled .Values.enableS3 }}
107
122
- name : MASTODON_S3_HOSTNAME
108
123
value : {{ include "mastodon.s3.host" . | quote }}
109
124
- name : MASTODON_S3_PORT_NUMBER
110
125
value : {{ include "mastodon.s3.port" . | quote }}
126
+ {{- if .Values.usePasswordFiles }}
127
+ - name : MASTODON_AWS_ACCESS_KEY_ID_FILE
128
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.s3.accessKeyIDKey" .) }}
129
+ - name : MASTODON_AWS_SECRET_ACCESS_KEY_FILE
130
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.s3.secretAccessKeyKey" .) }}
131
+ {{- else }}
111
132
- name : MASTODON_AWS_ACCESS_KEY_ID
112
133
valueFrom :
113
134
secretKeyRef :
@@ -119,6 +140,7 @@ spec:
119
140
name : {{ include "mastodon.s3.secretName" . }}
120
141
key : {{ include "mastodon.s3.secretAccessKeyKey" . | quote }}
121
142
{{- end }}
143
+ {{- end }}
122
144
envFrom :
123
145
- configMapRef :
124
146
name : {{ include "mastodon.defaultConfigmapName" . }}
@@ -130,6 +152,10 @@ spec:
130
152
subPath : tmp-dir
131
153
- name : scripts
132
154
mountPath : /scripts
155
+ {{- if .Values.usePasswordFiles }}
156
+ - name : mastodon-secrets
157
+ mountPath : /opt/bitnami/mastodon/secrets
158
+ {{- end }}
133
159
{{- end }}
134
160
containers :
135
161
# We separate the job in multiple containers to be able to run them in parallel. We put everything on the same job
@@ -150,26 +176,41 @@ spec:
150
176
env :
151
177
- name : BITNAMI_DEBUG
152
178
value : {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
179
+ {{- if .Values.usePasswordFiles }}
180
+ - name : MASTODON_DATABASE_PASSWORD_FILE
181
+ value : " /opt/bitnami/mastodon/secrets/db-password"
182
+ {{- else }}
153
183
- name : MASTODON_DATABASE_PASSWORD
154
184
valueFrom :
155
185
secretKeyRef :
156
186
name : {{ include "mastodon.database.secretName" . }}
157
187
key : {{ include "mastodon.database.passwordKey" . | quote }}
188
+ {{- end }}
158
189
{{- if (include "mastodon.redis.auth.enabled" .) }}
159
190
# The rake db:migrate job requires access to Redis
191
+ {{- if .Values.usePasswordFiles }}
192
+ - name : MASTODON_REDIS_PASSWORD_FILE
193
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.redis.passwordKey" .) }}
194
+ {{- else }}
160
195
- name : MASTODON_REDIS_PASSWORD
161
196
valueFrom :
162
197
secretKeyRef :
163
198
name : {{ include "mastodon.redis.secretName" . }}
164
199
key : {{ include "mastodon.redis.passwordKey" . | quote }}
165
200
{{- end }}
201
+ {{- end }}
166
202
{{- if (include "mastodon.elasticsearch.auth.enabled" .) }}
203
+ {{- if .Values.usePasswordFiles }}
204
+ - name : MASTODON_ELASTICSEARCH_PASSWORD_FILE
205
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.elasticsearch.passwordKey" .) }}
206
+ {{- else }}
167
207
- name : MASTODON_ELASTICSEARCH_PASSWORD
168
208
valueFrom :
169
209
secretKeyRef :
170
210
name : {{ include "mastodon.elasticsearch.secretName" . }}
171
211
key : {{ include "mastodon.elasticsearch.passwordKey" . | quote }}
172
212
{{- end }}
213
+ {{- end }}
173
214
{{- if .Values.initJob.migrateAndCreateAdmin.extraEnvVars }}
174
215
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.migrateAndCreateAdmin.extraEnvVars "context" $) | nindent 12 }}
175
216
{{- end }}
@@ -202,6 +243,10 @@ spec:
202
243
subPath : tmp-dir
203
244
- name : scripts
204
245
mountPath : /scripts
246
+ {{- if .Values.usePasswordFiles }}
247
+ - name : mastodon-secrets
248
+ mountPath : /opt/bitnami/mastodon/secrets
249
+ {{- end }}
205
250
{{- if .Values.initJob.migrateAndCreateAdmin.extraVolumeMounts }}
206
251
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.migrateAndCreateAdmin.extraVolumeMounts "context" $) | nindent 12 }}
207
252
{{- end }}
@@ -231,6 +276,12 @@ spec:
231
276
value : {{ include "mastodon.s3.host" . | quote }}
232
277
- name : MASTODON_S3_PORT_NUMBER
233
278
value : {{ include "mastodon.s3.port" . | quote }}
279
+ {{- if .Values.usePasswordFiles }}
280
+ - name : MASTODON_AWS_ACCESS_KEY_ID_FILE
281
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.s3.accessKeyIDKey" .) }}
282
+ - name : MASTODON_AWS_SECRET_ACCESS_KEY_FILE
283
+ value : {{ printf "/opt/bitnami/mastodon/secrets/%s" (include "mastodon.s3.secretAccessKeyKey" .) }}
284
+ {{- else }}
234
285
- name : MASTODON_AWS_ACCESS_KEY_ID
235
286
valueFrom :
236
287
secretKeyRef :
@@ -242,6 +293,7 @@ spec:
242
293
name : {{ include "mastodon.s3.secretName" . }}
243
294
key : {{ include "mastodon.s3.secretAccessKeyKey" . | quote }}
244
295
{{- end }}
296
+ {{- end }}
245
297
{{- if .Values.initJob.precompileAssets.extraEnvVars }}
246
298
{{- include "common.tplvalues.render" (dict "value" .Values.initJob.precompileAssets.extraEnvVars "context" $) | nindent 12 }}
247
299
{{- end }}
@@ -283,6 +335,10 @@ spec:
283
335
subPath : cache-dir
284
336
- name : scripts
285
337
mountPath : /scripts
338
+ {{- if .Values.usePasswordFiles }}
339
+ - name : mastodon-secrets
340
+ mountPath : /opt/bitnami/mastodon/secrets
341
+ {{- end }}
286
342
{{- if not .Values.enableS3 }}
287
343
- name : data
288
344
mountPath : {{ .Values.persistence.mountPath }}
@@ -299,6 +355,28 @@ spec:
299
355
volumes :
300
356
- name : empty-dir
301
357
emptyDir : {}
358
+ {{- if .Values.usePasswordFiles }}
359
+ - name : mastodon-secrets
360
+ projected :
361
+ sources :
362
+ - secret :
363
+ name : {{ include "mastodon.database.secretName" . }}
364
+ items :
365
+ - key : {{ include "mastodon.database.passwordKey" . }}
366
+ path : db-password
367
+ {{- if (include "mastodon.redis.auth.enabled" .) }}
368
+ - secret :
369
+ name : {{ include "mastodon.redis.secretName" . }}
370
+ {{- end }}
371
+ {{- if (include "mastodon.elasticsearch.auth.enabled" .) }}
372
+ - secret :
373
+ name : {{ include "mastodon.elasticsearch.secretName" . }}
374
+ {{- end }}
375
+ {{- if .Values.enableS3 }}
376
+ - secret :
377
+ name : {{ include "mastodon.s3.secretName" . }}
378
+ {{- end }}
379
+ {{- end }}
302
380
- name : scripts
303
381
configMap :
304
382
name : {{ printf "%s-init-scripts" (include "common.names.fullname" .) }}
0 commit comments