@@ -250,11 +250,16 @@ spec:
250
250
{{- end }}
251
251
- name : RABBITMQ_USE_LONGNAME
252
252
value : " true"
253
+ {{- if .Values.usePasswordFiles }}
254
+ - name : RABBITMQ_ERL_COOKIE_FILE
255
+ value : {{ printf "/opt/bitnami/rabbitmq/secrets/%s" (include "rabbitmq.secretErlangKey" .) }}
256
+ {{- else }}
253
257
- name : RABBITMQ_ERL_COOKIE
254
258
valueFrom :
255
259
secretKeyRef :
256
260
name : {{ template "rabbitmq.secretErlangName" . }}
257
261
key : {{ template "rabbitmq.secretErlangKey" . }}
262
+ {{- end }}
258
263
{{- if and .Values.clustering.rebalance (gt (.Values.replicaCount | int) 1) }}
259
264
- name : RABBITMQ_CLUSTER_REBALANCE
260
265
value : " true"
@@ -267,11 +272,16 @@ spec:
267
272
value : {{ ternary "yes" "no" (or .Values.auth.securePassword (not .Values.auth.password)) | quote }}
268
273
- name : RABBITMQ_USERNAME
269
274
value : {{ .Values.auth.username | quote }}
275
+ {{- if .Values.usePasswordFiles }}
276
+ - name : RABBITMQ_PASSWORD_FILE
277
+ value : {{ printf "/opt/bitnami/rabbitmq/secrets/%s" (include "rabbitmq.secretPasswordKey" .) }}
278
+ {{- else }}
270
279
- name : RABBITMQ_PASSWORD
271
280
valueFrom :
272
281
secretKeyRef :
273
282
name : {{ template "rabbitmq.secretPasswordName" . }}
274
283
key : {{ template "rabbitmq.secretPasswordKey" . }}
284
+ {{- end }}
275
285
- name : RABBITMQ_PLUGINS
276
286
value : {{ include "rabbitmq.plugins" . | quote }}
277
287
{{- if .Values.communityPlugins }}
@@ -327,12 +337,12 @@ spec:
327
337
livenessProbe : {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
328
338
exec :
329
339
command :
330
- - sh
340
+ - /bin/bash
331
341
- -ec
332
342
{{- if or (.Values.loadDefinition.enabled) (not (contains "rabbitmq_management" .Values.plugins )) }}
333
343
- rabbitmq-diagnostics -q ping
334
344
{{- else }}
335
- - curl -f --user {{ .Values.auth.username }}:$ RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.containerPorts.manager }}/api/health/checks/virtual-hosts
345
+ - curl -f --user {{ .Values.auth.username }}:{{ ternary "$(< $RABBITMQ_PASSWORD_FILE)" "$ RABBITMQ_PASSWORD" .Values.usePasswordFiles }} 127.0.0.1:{{ .Values.containerPorts.manager }}/api/health/checks/virtual-hosts
336
346
{{- end }}
337
347
{{- end }}
338
348
{{- if .Values.customReadinessProbe }}
@@ -341,12 +351,12 @@ spec:
341
351
readinessProbe : {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
342
352
exec :
343
353
command :
344
- - sh
354
+ - /bin/bash
345
355
- -ec
346
356
{{- if or (.Values.loadDefinition.enabled) (not (contains "rabbitmq_management" .Values.plugins )) }}
347
357
- rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms
348
358
{{- else }}
349
- - curl -f --user {{ .Values.auth.username }}:$ RABBITMQ_PASSWORD 127.0.0.1:{{ .Values.containerPorts.manager }}/api/health/checks/local-alarms
359
+ - curl -f --user {{ .Values.auth.username }}:{{ ternary "$(< $RABBITMQ_PASSWORD_FILE)" "$ RABBITMQ_PASSWORD" .Values.usePasswordFiles }} 127.0.0.1:{{ .Values.containerPorts.manager }}/api/health/checks/local-alarms
350
360
{{- end }}
351
361
{{- end }}
352
362
{{- if .Values.customStartupProbe }}
@@ -388,6 +398,10 @@ spec:
388
398
{{- if .Values.persistence.subPath }}
389
399
subPath : {{ .Values.persistence.subPath }}
390
400
{{- end }}
401
+ {{- if .Values.usePasswordFiles }}
402
+ - name : rabbitmq-secrets
403
+ mountPath : /opt/bitnami/rabbitmq/secrets
404
+ {{- end }}
391
405
{{- if .Values.auth.tls.enabled }}
392
406
- name : certs
393
407
mountPath : /opt/bitnami/rabbitmq/certs
@@ -429,10 +443,10 @@ spec:
429
443
- secret :
430
444
name : {{ template "rabbitmq.tlsSecretName" . }}
431
445
items :
432
- {{- if not .Values.auth.tls.overrideCaCertificate }}
446
+ {{- if not .Values.auth.tls.overrideCaCertificate }}
433
447
- key : {{ ternary "tls.crt" "ca.crt" .Values.auth.tls.existingSecretFullChain }}
434
448
path : ca_certificate.pem
435
- {{- end }}
449
+ {{- end }}
436
450
- key : tls.crt
437
451
path : server_certificate.pem
438
452
- key : tls.key
@@ -456,7 +470,7 @@ spec:
456
470
{{- if or (and (empty .Values.configurationExistingSecret) .Values.configuration) (and (not .Values.advancedConfigurationExistingSecret) .Values.advancedConfiguration) }}
457
471
- secret :
458
472
name : {{ printf "%s-config" (include "common.names.fullname" .) }}
459
- {{- end }}
473
+ {{- end }}
460
474
{{- if and .Values.advancedConfigurationExistingSecret (not .Values.advancedConfiguration) }}
461
475
- secret :
462
476
name : {{ tpl .Values.advancedConfigurationExistingSecret . | quote }}
@@ -465,6 +479,15 @@ spec:
465
479
- secret :
466
480
name : {{ tpl .Values.configurationExistingSecret . | quote }}
467
481
{{- end }}
482
+ {{- if .Values.usePasswordFiles }}
483
+ - name : rabbitmq-secrets
484
+ projected :
485
+ sources :
486
+ - secret :
487
+ name : {{ template "rabbitmq.secretPasswordName" . }}
488
+ - secret :
489
+ name : {{ template "rabbitmq.secretErlangName" . }}
490
+ {{- end }}
468
491
{{- if .Values.loadDefinition.enabled }}
469
492
- name : load-definition-volume
470
493
secret :
@@ -498,7 +521,7 @@ spec:
498
521
{{- with .Values.persistence.existingClaim }}
499
522
claimName : {{ tpl . $ }}
500
523
{{- end }}
501
- {{- else }}
524
+ {{- else }}
502
525
{{- if .Values.persistentVolumeClaimRetentionPolicy.enabled }}
503
526
persistentVolumeClaimRetentionPolicy :
504
527
whenDeleted : {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }}
0 commit comments