From ca6ad711a459741c451b0c2d2f2e0869075ee37c Mon Sep 17 00:00:00 2001 From: Steven Fitzpatrick Date: Thu, 7 Nov 2019 20:55:21 -0600 Subject: [PATCH] RabbitMQ Exporter: Replace Direct Values w/ HTK This change replaces direct references to the exporter port in values.yaml with calls to helm-toolkit lookup functions. The referenced port number under the network key is removed, as the helm-toolkit function will return the port number under the endpoints key. Change-Id: Ib6f533c49af5a88fca377920d28d5468d7387892 --- .../templates/monitoring/prometheus/exporter-deployment.yaml | 4 ++-- .../templates/monitoring/prometheus/exporter-service.yaml | 2 +- rabbitmq/values.yaml | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/rabbitmq/templates/monitoring/prometheus/exporter-deployment.yaml b/rabbitmq/templates/monitoring/prometheus/exporter-deployment.yaml index 86f26de37..ab58c3259 100644 --- a/rabbitmq/templates/monitoring/prometheus/exporter-deployment.yaml +++ b/rabbitmq/templates/monitoring/prometheus/exporter-deployment.yaml @@ -52,7 +52,7 @@ spec: {{ dict "envAll" $envAll "application" "exporter" "container" "rabbitmq_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }} ports: - name: metrics - containerPort: {{ $envAll.Values.network.prometheus_rabbitmq_exporter.port }} + containerPort: {{ tuple "prometheus_rabbitmq_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} env: - name: RABBIT_URL value: http://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}:15672 @@ -63,7 +63,7 @@ spec: - name: RABBIT_CAPABILITIES value: {{ include "helm-toolkit.utils.joinListWithComma" $envAll.Values.conf.prometheus_exporter.capabilities | quote }} - name: PUBLISH_PORT - value: {{ $envAll.Values.network.prometheus_rabbitmq_exporter.port | quote }} + value: {{ tuple "prometheus_rabbitmq_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - name: LOG_LEVEL value: {{ $envAll.Values.conf.prometheus_exporter.log_level | quote }} - name: SKIPVERIFY diff --git a/rabbitmq/templates/monitoring/prometheus/exporter-service.yaml b/rabbitmq/templates/monitoring/prometheus/exporter-service.yaml index f49a12674..472c3a5ee 100644 --- a/rabbitmq/templates/monitoring/prometheus/exporter-service.yaml +++ b/rabbitmq/templates/monitoring/prometheus/exporter-service.yaml @@ -31,7 +31,7 @@ metadata: spec: ports: - name: metrics - port: {{ $envAll.Values.network.prometheus_rabbitmq_exporter.port }} + port: {{ tuple "prometheus_rabbitmq_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} selector: {{ tuple $envAll "prometheus_rabbitmq_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{- end }} diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index 1b5c933da..22cff02d4 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -226,8 +226,6 @@ network: cluster: "nginx-cluster" annotations: nginx.ingress.kubernetes.io/rewrite-target: / - prometheus_rabbitmq_exporter: - port: 9095 # typically overridden by environmental # values, but should include all endpoints