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
This commit is contained in:
Steven Fitzpatrick 2019-11-07 20:55:21 -06:00 committed by Steve Wilkerson
parent 0edd3e18de
commit ca6ad711a4
3 changed files with 3 additions and 5 deletions

View File

@ -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

View File

@ -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 }}

View File

@ -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