diff --git a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml index 83aedf52df00..99c50e75662b 100644 --- a/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml +++ b/charts/prometheus-rabbitmq-exporter/templates/deployment.yaml @@ -59,8 +59,13 @@ spec: - name: RABBIT_PASSWORD value: {{ .Values.rabbitmq.password }} {{- end }} - - {{- if .Values.rabbitmq.user }} + {{- if .Values.rabbitmq.existingUserSecret }} + - name: RABBIT_USER + valueFrom: + secretKeyRef: + name: "{{ .Values.rabbitmq.existingUserSecret }}" + key: "{{ .Values.rabbitmq.existingUserSecretKey }}" + {{- else if .Values.rabbitmq.user }} - name: RABBIT_USER value: {{ .Values.rabbitmq.user }} {{- end }} diff --git a/charts/prometheus-rabbitmq-exporter/values.yaml b/charts/prometheus-rabbitmq-exporter/values.yaml index 029e1e9b95e4..c28a0c303de3 100644 --- a/charts/prometheus-rabbitmq-exporter/values.yaml +++ b/charts/prometheus-rabbitmq-exporter/values.yaml @@ -39,6 +39,9 @@ rabbitmq: url: http://myrabbit:15672 user: guest password: guest + # If existingUserSecret is set then user is ignored + existingUserSecret: ~ + existingUserSecretKey: username # If existingPasswordSecret is set then password is ignored existingPasswordSecret: ~ existingPasswordSecretKey: password