[stable/rabbitmq] Metrics: use ipv4 to connect to rabbit. (#17092)

* [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 <cdesaintmartin@wiremind.fr>

* Make it configurable.

Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
This commit is contained in:
Cédric de Saint Martin
2019-09-16 00:16:37 -07:00
committed by Kubernetes Prow Robot
parent 67f4e2c3b4
commit 86ad014dce
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -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:
+3 -3
View File
@@ -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 }}
+4
View File
@@ -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"