From 86ad014dcea02184cbef285ddd308abdf951f8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20de=20Saint=20Martin?= Date: Mon, 16 Sep 2019 09:16:37 +0200 Subject: [PATCH] [stable/rabbitmq] Metrics: use ipv4 to connect to rabbit. (#17092) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [stable/rabbitmq] Metrics: use ipv4 to connect to rabbit. Otherwise, it could try to access IPv6 which may not be available, causing: Get http://localhost:15672/api/nodes?sort=: dial tcp [::1]:15672: connect: cannot assign requested address Signed-off-by: Cédric de Saint Martin * Make it configurable. Signed-off-by: Cédric de Saint Martin --- stable/rabbitmq/Chart.yaml | 2 +- stable/rabbitmq/templates/statefulset.yaml | 6 +++--- stable/rabbitmq/values.yaml | 4 ++++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stable/rabbitmq/Chart.yaml b/stable/rabbitmq/Chart.yaml index 0c394a70a1..612874d001 100644 --- a/stable/rabbitmq/Chart.yaml +++ b/stable/rabbitmq/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: rabbitmq -version: 6.4.5 +version: 6.5.0 appVersion: 3.7.17 description: Open source message broker software that implements the Advanced Message Queuing Protocol (AMQP) keywords: diff --git a/stable/rabbitmq/templates/statefulset.yaml b/stable/rabbitmq/templates/statefulset.yaml index 63d5353e3a..c816456c47 100644 --- a/stable/rabbitmq/templates/statefulset.yaml +++ b/stable/rabbitmq/templates/statefulset.yaml @@ -156,7 +156,7 @@ spec: command: - sh - -c - - rabbitmq-api-check "http://{{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD@127.0.0.1:{{ .Values.service.managerPort }}/api/healthchecks/node" '{"status":"ok"}' + - rabbitmq-api-check "http://{{ .Values.rabbitmq.username }}:$RABBITMQ_PASSWORD@127.0.0.1:{{ .Values.service.managerPort }}/api/healthchecks/node" '{"status":"ok"}' initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} periodSeconds: {{ .Values.livenessProbe.periodSeconds }} @@ -243,7 +243,7 @@ spec: name: {{ template "rabbitmq.secretPasswordName" . }} key: rabbitmq-password - name: RABBIT_URL - value: "http://localhost:{{ .Values.service.managerPort }}" + value: "http://{{ .Values.metrics.rabbitmqAddress }}:{{ .Values.service.managerPort }}" - name: RABBIT_USER value: {{ .Values.rabbitmq.username }} {{ if .Values.metrics.capabilities }} @@ -288,7 +288,7 @@ spec: {{- if .Values.rabbitmq.advancedConfiguration}} - key: advanced.config path: advanced.config - {{- end }} + {{- end }} - key: enabled_plugins path: enabled_plugins {{- if .Values.rabbitmq.loadDefinition.enabled }} diff --git a/stable/rabbitmq/values.yaml b/stable/rabbitmq/values.yaml index efabcff5b6..a8a799b623 100644 --- a/stable/rabbitmq/values.yaml +++ b/stable/rabbitmq/values.yaml @@ -310,6 +310,10 @@ metrics: env: {} ## Metrics exporter port port: 9419 + ## RabbitMQ address to connect to (from the same Pod, usually the local loopback address). + ## If your Kubernetes cluster does not support IPv6, you can change to `127.0.0.1` in order to force IPv4. + ## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#networking + rabbitmqAddress: localhost ## Comma-separated list of extended scraping capabilities supported by the target RabbitMQ server ## ref: https://github.com/kbudde/rabbitmq_exporter#extended-rabbitmq-capabilities capabilities: "bert,no_sort"