From acf9be96d355dfc1b94dc9b8517ea5e5e618d780 Mon Sep 17 00:00:00 2001 From: jonnydford Date: Sat, 22 Jun 2019 08:20:12 +0100 Subject: [PATCH] Added support for existing rabbitmq password secret (#14958) Signed-off-by: Jonny Ford --- stable/prometheus-rabbitmq-exporter/Chart.yaml | 2 +- stable/prometheus-rabbitmq-exporter/README.md | 9 +++++---- .../templates/deployment.yaml | 8 ++++++++ stable/prometheus-rabbitmq-exporter/values.yaml | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/stable/prometheus-rabbitmq-exporter/Chart.yaml b/stable/prometheus-rabbitmq-exporter/Chart.yaml index d696a97120..dccdc6b77e 100644 --- a/stable/prometheus-rabbitmq-exporter/Chart.yaml +++ b/stable/prometheus-rabbitmq-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Rabbitmq metrics exporter for prometheus name: prometheus-rabbitmq-exporter -version: 0.5.0 +version: 0.5.1 appVersion: v0.29.0 home: https://github.com/kbudde/rabbitmq_exporter sources: diff --git a/stable/prometheus-rabbitmq-exporter/README.md b/stable/prometheus-rabbitmq-exporter/README.md index 05b7a3c9e2..0fcd057ebe 100644 --- a/stable/prometheus-rabbitmq-exporter/README.md +++ b/stable/prometheus-rabbitmq-exporter/README.md @@ -54,6 +54,7 @@ The following table lists the configurable parameters and their default values. | `rabbitmq.url` | rabbitmq management url | `http://myrabbit:15672` | | `rabbitmq.user` | rabbitmq user login | `guest` | | `rabbitmq.password` | rabbitmq password login | `guest` | +| `rabbitmq.existingPasswordSecret` | existing secret name containing password key | `~` | | `rabbitmq.capabilities` | comma-separated list of capabilities supported by the RabbitMQ server | `bert,no_sort` | | `rabbitmq.include_queues`| regex queue filter. just matching names are exported | `.*` | | `rabbitmq.skip_queues` | regex, matching queue names are not exported | `^$` | @@ -65,10 +66,10 @@ The following table lists the configurable parameters and their default values. | `rabbitmq.timeout` | timeout in seconds for retrieving data from management plugin | `30` | | `rabbitmq.max_queues` | max number of queues before we drop metrics (disabled if set to 0) | `0` | | `annotations` | pod annotations for easier discovery | {} | -| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | -| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} | -| `prometheus.monitor.interval` | Interval at which Prometheus Operator scrapes exporter | `15s` | -| `prometheus.monitor.namespace` | Selector to select which namespaces the Endpoints objects are discovered from. | [] | +| `prometheus.monitor.enabled` | Set this to `true` to create ServiceMonitor for Prometheus operator | `false` | +| `prometheus.monitor.additionalLabels` | Additional labels that can be used so ServiceMonitor will be discovered by Prometheus | {} | +| `prometheus.monitor.interval` | Interval at which Prometheus Operator scrapes exporter | `15s` | +| `prometheus.monitor.namespace` | Selector to select which namespaces the Endpoints objects are discovered from. | [] | For more information please refer to the [rabbitmq_exporter](https://github.com/kbudde/rabbitmq_exporter) documentation. diff --git a/stable/prometheus-rabbitmq-exporter/templates/deployment.yaml b/stable/prometheus-rabbitmq-exporter/templates/deployment.yaml index 4f2220e279..d01c749ab7 100644 --- a/stable/prometheus-rabbitmq-exporter/templates/deployment.yaml +++ b/stable/prometheus-rabbitmq-exporter/templates/deployment.yaml @@ -30,8 +30,16 @@ spec: value: "{{ .Values.rabbitmq.url }}" - name: RABBIT_USER value: "{{ .Values.rabbitmq.user }}" + {{- if .Values.rabbitmq.existingPasswordSecret }} + - name: RABBIT_PASSWORD + valueFrom: + secretKeyRef: + name: "{{ .Values.rabbitmq.existingPasswordSecret }}" + key: password + {{- else }} - name: RABBIT_PASSWORD value: "{{ .Values.rabbitmq.password }}" + {{- end }} - name: PUBLISH_PORT value: "{{ .Values.service.internalPort }}" - name: LOG_LEVEL diff --git a/stable/prometheus-rabbitmq-exporter/values.yaml b/stable/prometheus-rabbitmq-exporter/values.yaml index 596c45b57a..f68e5f7e2a 100644 --- a/stable/prometheus-rabbitmq-exporter/values.yaml +++ b/stable/prometheus-rabbitmq-exporter/values.yaml @@ -33,6 +33,8 @@ rabbitmq: url: http://myrabbit:15672 user: guest password: guest + # If existingPasswordSecret is set then password is ignored + existingPasswordSecret: ~ capabilities: bert,no_sort include_queues: ".*" include_vhost: ".*"