Skip to content

Commit 4a88674

Browse files
[bitnami/rabbitmq] Set usePasswordFiles=true by default (#32768)
* [bitnami/rabbitmq] Set `usePasswordFiles=true` by default Signed-off-by: Miguel Ruiz <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Bot <[email protected]> * Update README.md with readme-generator-for-helm Signed-off-by: Bitnami Bot <[email protected]> * Update CHANGELOG.md Signed-off-by: Bitnami Bot <[email protected]> * Fix probes Signed-off-by: Miguel Ruiz <[email protected]> * Use ternary Signed-off-by: Miguel Ruiz <[email protected]> --------- Signed-off-by: Miguel Ruiz <[email protected]> Signed-off-by: Bitnami Bot <[email protected]> Co-authored-by: Bitnami Bot <[email protected]>
1 parent bd67257 commit 4a88674

File tree

5 files changed

+42
-11
lines changed

5 files changed

+42
-11
lines changed

bitnami/rabbitmq/CHANGELOG.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
# Changelog
22

3-
## 15.4.2 (2025-04-03)
3+
## 15.5.0 (2025-04-04)
44

5-
* [bitnami/rabbitmq] Release 15.4.2 ([#32793](https://github.com/bitnami/charts/pull/32793))
5+
* [bitnami/rabbitmq] Set `usePasswordFiles=true` by default ([#32768](https://github.com/bitnami/charts/pull/32768))
6+
7+
## <small>15.4.2 (2025-04-03)</small>
8+
9+
* [bitnami/rabbitmq] Release 15.4.2 (#32793) ([b6e252b](https://github.com/bitnami/charts/commit/b6e252bd85d43b7686ff0c9b525b91563e557af8)), closes [#32793](https://github.com/bitnami/charts/issues/32793)
610

711
## <small>15.4.1 (2025-03-28)</small>
812

bitnami/rabbitmq/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ maintainers:
3131
name: rabbitmq
3232
sources:
3333
- https://github.com/bitnami/charts/tree/main/bitnami/rabbitmq
34-
version: 15.4.2
34+
version: 15.5.0

bitnami/rabbitmq/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ Because they expose different sets of data, a valid use case is to scrape metric
413413
| `commonLabels` | Labels to add to all deployed objects | `{}` |
414414
| `serviceBindings.enabled` | Create secret for service binding (Experimental) | `false` |
415415
| `enableServiceLinks` | Whether information about services should be injected into pod's environment variable | `true` |
416+
| `usePasswordFiles` | Mount credentials as files instead of using environment variables | `true` |
416417
| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` |
417418
| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` |
418419
| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` |

bitnami/rabbitmq/templates/statefulset.yaml

+31-8
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,16 @@ spec:
250250
{{- end }}
251251
- name: RABBITMQ_USE_LONGNAME
252252
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 }}
253257
- name: RABBITMQ_ERL_COOKIE
254258
valueFrom:
255259
secretKeyRef:
256260
name: {{ template "rabbitmq.secretErlangName" . }}
257261
key: {{ template "rabbitmq.secretErlangKey" . }}
262+
{{- end }}
258263
{{- if and .Values.clustering.rebalance (gt (.Values.replicaCount | int) 1) }}
259264
- name: RABBITMQ_CLUSTER_REBALANCE
260265
value: "true"
@@ -267,11 +272,16 @@ spec:
267272
value: {{ ternary "yes" "no" (or .Values.auth.securePassword (not .Values.auth.password)) | quote }}
268273
- name: RABBITMQ_USERNAME
269274
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 }}
270279
- name: RABBITMQ_PASSWORD
271280
valueFrom:
272281
secretKeyRef:
273282
name: {{ template "rabbitmq.secretPasswordName" . }}
274283
key: {{ template "rabbitmq.secretPasswordKey" . }}
284+
{{- end }}
275285
- name: RABBITMQ_PLUGINS
276286
value: {{ include "rabbitmq.plugins" . | quote }}
277287
{{- if .Values.communityPlugins }}
@@ -327,12 +337,12 @@ spec:
327337
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
328338
exec:
329339
command:
330-
- sh
340+
- /bin/bash
331341
- -ec
332342
{{- if or (.Values.loadDefinition.enabled) (not (contains "rabbitmq_management" .Values.plugins )) }}
333343
- rabbitmq-diagnostics -q ping
334344
{{- 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
336346
{{- end }}
337347
{{- end }}
338348
{{- if .Values.customReadinessProbe }}
@@ -341,12 +351,12 @@ spec:
341351
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
342352
exec:
343353
command:
344-
- sh
354+
- /bin/bash
345355
- -ec
346356
{{- if or (.Values.loadDefinition.enabled) (not (contains "rabbitmq_management" .Values.plugins )) }}
347357
- rabbitmq-diagnostics -q check_running && rabbitmq-diagnostics -q check_local_alarms
348358
{{- 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
350360
{{- end }}
351361
{{- end }}
352362
{{- if .Values.customStartupProbe }}
@@ -388,6 +398,10 @@ spec:
388398
{{- if .Values.persistence.subPath }}
389399
subPath: {{ .Values.persistence.subPath }}
390400
{{- end }}
401+
{{- if .Values.usePasswordFiles }}
402+
- name: rabbitmq-secrets
403+
mountPath: /opt/bitnami/rabbitmq/secrets
404+
{{- end }}
391405
{{- if .Values.auth.tls.enabled }}
392406
- name: certs
393407
mountPath: /opt/bitnami/rabbitmq/certs
@@ -429,10 +443,10 @@ spec:
429443
- secret:
430444
name: {{ template "rabbitmq.tlsSecretName" . }}
431445
items:
432-
{{- if not .Values.auth.tls.overrideCaCertificate }}
446+
{{- if not .Values.auth.tls.overrideCaCertificate }}
433447
- key: {{ ternary "tls.crt" "ca.crt" .Values.auth.tls.existingSecretFullChain }}
434448
path: ca_certificate.pem
435-
{{- end }}
449+
{{- end }}
436450
- key: tls.crt
437451
path: server_certificate.pem
438452
- key: tls.key
@@ -456,7 +470,7 @@ spec:
456470
{{- if or (and (empty .Values.configurationExistingSecret) .Values.configuration) (and (not .Values.advancedConfigurationExistingSecret) .Values.advancedConfiguration) }}
457471
- secret:
458472
name: {{ printf "%s-config" (include "common.names.fullname" .) }}
459-
{{- end }}
473+
{{- end }}
460474
{{- if and .Values.advancedConfigurationExistingSecret (not .Values.advancedConfiguration) }}
461475
- secret:
462476
name: {{ tpl .Values.advancedConfigurationExistingSecret . | quote }}
@@ -465,6 +479,15 @@ spec:
465479
- secret:
466480
name: {{ tpl .Values.configurationExistingSecret . | quote }}
467481
{{- 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 }}
468491
{{- if .Values.loadDefinition.enabled }}
469492
- name: load-definition-volume
470493
secret:
@@ -498,7 +521,7 @@ spec:
498521
{{- with .Values.persistence.existingClaim }}
499522
claimName: {{ tpl . $ }}
500523
{{- end }}
501-
{{- else }}
524+
{{- else }}
502525
{{- if .Values.persistentVolumeClaimRetentionPolicy.enabled }}
503526
persistentVolumeClaimRetentionPolicy:
504527
whenDeleted: {{ .Values.persistentVolumeClaimRetentionPolicy.whenDeleted }}

bitnami/rabbitmq/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ serviceBindings:
107107
## If you experience slow pod startups or slow running of the scripts you probably want to set this to `false`.
108108
##
109109
enableServiceLinks: true
110+
## @param usePasswordFiles Mount credentials as files instead of using environment variables
111+
##
112+
usePasswordFiles: true
110113
## Enable diagnostic mode in the deployment
111114
##
112115
diagnosticMode:

0 commit comments

Comments
 (0)