@@ -201,11 +201,16 @@ Add environment variables to configure database values
201
201
- name: SUPERSET_DATABASE_USER
202
202
value: { { include " superset.database.user" . | quote } }
203
203
{ {- if or (not .Values.postgresql.enabled) .Values.postgresql.auth.enablePostgresUser } }
204
+ { {- if .Values.usePasswordFiles } }
205
+ - name: SUPERSET_DATABASE_PASSWORD_FILE
206
+ value: { { printf " /opt/bitnami/superset/secrets/%s" (include " superset.database.secretKey" .) } }
207
+ { {- else } }
204
208
- name: SUPERSET_DATABASE_PASSWORD
205
209
valueFrom:
206
210
secretKeyRef:
207
211
name: { { include " superset.postgresql.secretName" . } }
208
212
key: { { include " superset.database.secretKey" . } }
213
+ { {- end } }
209
214
{ {- else } }
210
215
- name: ALLOW_EMPTY_PASSWORD
211
216
value: "true"
@@ -222,22 +227,32 @@ Add environment variables to configure redis values
222
227
value: { { include " superset.redis.port" . | quote } }
223
228
- name: REDIS_USER
224
229
value: { { ternary " default" .Values.externalRedis.username .Values.redis.enabled | quote } }
230
+ { {- if .Values.usePasswordFiles } }
231
+ - name: REDIS_PASSWORD_FILE
232
+ value: { { printf " /opt/bitnami/superset/secrets/%s" (include " superset.redis.secretKey" .) } }
233
+ { {- else } }
225
234
- name: REDIS_PASSWORD
226
235
valueFrom:
227
236
secretKeyRef:
228
237
name: { { include " superset.redis.secretName" . } }
229
238
key: { { include " superset.redis.secretKey" . } }
239
+ { {- end } }
230
240
{ {- end -} }
231
241
232
242
{ {/*
233
243
Add environment variables to configure superset common values
234
244
*/} }
235
245
{ {- define " superset.configure.common" -} }
246
+ { {- if .Values.usePasswordFiles } }
247
+ - name: SUPERSET_SECRET_KEY_FILE
248
+ value: "/opt/bitnami/superset/secrets/superset-secret-key"
249
+ { {- else } }
236
250
- name: SUPERSET_SECRET_KEY
237
251
valueFrom:
238
252
secretKeyRef:
239
253
name: { { include " superset.secretName" . } }
240
254
key: superset-secret-key
255
+ { {- end } }
241
256
{ {- if or .Values.existingConfigmap .Values.config } }
242
257
- name: SUPERSET_CONF_FILE
243
258
value: "/bitnami/superset/conf/superset_config.py"
@@ -276,6 +291,10 @@ Init container definition to wait for PostgreSQL
276
291
. /opt/bitnami/scripts/liblog.sh
277
292
. /opt/bitnami/scripts/libpostgresql.sh
278
293
294
+ { {- if .Values.usePasswordFiles } }
295
+ export SUPERSET_DATABASE_PASSWORD="$(< $SUPERSET_DATABASE_PASSWORD_FILE)"
296
+ { {- end } }
297
+
279
298
check_postgresql_connection() {
280
299
echo " SELECT 1" | postgresql_remote_execute " $SUPERSET_DATABASE_HOST" " $SUPERSET_DATABASE_PORT_NUMBER" " $SUPERSET_DATABASE_NAME" " $SUPERSET_DATABASE_USER" " $SUPERSET_DATABASE_PASSWORD"
281
300
}
@@ -289,6 +308,12 @@ Init container definition to wait for PostgreSQL
289
308
fi
290
309
env:
291
310
{ {- include " superset.configure.database" . | nindent 4 } }
311
+ { {- if .Values.usePasswordFiles } }
312
+ volumeMounts:
313
+ - name: superset-secrets
314
+ mountPath: /opt/bitnami/superset/secrets
315
+ readOnly: true
316
+ { {- end } }
292
317
{ {- end -} }
293
318
294
319
{ {/*
@@ -320,6 +345,10 @@ Init container definition to wait for Redis
320
345
. /opt/bitnami/scripts/libos.sh
321
346
. /opt/bitnami/scripts/liblog.sh
322
347
348
+ { {- if .Values.usePasswordFiles } }
349
+ export REDIS_PASSWORD="$(< $REDIS_PASSWORD_FILE)"
350
+ { {- end } }
351
+
323
352
check_redis_connection() {
324
353
local result= " $(redis-cli -h ${REDIS_HOST} -p ${REDIS_PORT_NUMBER} -a ${REDIS_PASSWORD} --user ${REDIS_USER} PING)"
325
354
if [[ " $result" != " PONG" ]]; then
@@ -336,6 +365,12 @@ Init container definition to wait for Redis
336
365
fi
337
366
env:
338
367
{ {- include " superset.configure.redis" . | nindent 4 } }
368
+ { {- if .Values.usePasswordFiles } }
369
+ volumeMounts:
370
+ - name: superset-secrets
371
+ mountPath: /opt/bitnami/superset/secrets
372
+ readOnly: true
373
+ { {- end } }
339
374
{ {- end } }
340
375
341
376
{ {- define " superset.initContainers.waitForExamples" -} }
@@ -365,6 +400,10 @@ Init container definition to wait for Redis
365
400
. /opt/bitnami/scripts/liblog.sh
366
401
. /opt/bitnami/scripts/libpostgresql.sh
367
402
403
+ { {- if .Values.usePasswordFiles } }
404
+ export SUPERSET_DATABASE_PASSWORD="$(< $SUPERSET_DATABASE_PASSWORD_FILE)"
405
+ { {- end } }
406
+
368
407
check_examples_database() {
369
408
echo " SELECT dashboard_title FROM dashboards" | postgresql_remote_execute_print_output " $SUPERSET_DATABASE_HOST" " $SUPERSET_DATABASE_PORT_NUMBER" " $SUPERSET_DATABASE_NAME" " $SUPERSET_DATABASE_USER" " $SUPERSET_DATABASE_PASSWORD" | grep " Dashboard"
370
409
}
@@ -378,6 +417,12 @@ Init container definition to wait for Redis
378
417
fi
379
418
env:
380
419
{ {- include " superset.configure.database" . | nindent 4 } }
420
+ { {- if .Values.usePasswordFiles } }
421
+ volumeMounts:
422
+ - name: superset-secrets
423
+ mountPath: /opt/bitnami/superset/secrets
424
+ readOnly: true
425
+ { {- end } }
381
426
{ {- end } }
382
427
383
428
{ {/*
0 commit comments