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 }} {{ dict "envAll" $envAll "application" "exporter" "container" "rabbitmq_exporter" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
ports: ports:
- name: metrics - 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: env:
- name: RABBIT_URL - name: RABBIT_URL
value: http://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}:15672 value: http://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}:15672
@ -63,7 +63,7 @@ spec:
- name: RABBIT_CAPABILITIES - name: RABBIT_CAPABILITIES
value: {{ include "helm-toolkit.utils.joinListWithComma" $envAll.Values.conf.prometheus_exporter.capabilities | quote }} value: {{ include "helm-toolkit.utils.joinListWithComma" $envAll.Values.conf.prometheus_exporter.capabilities | quote }}
- name: PUBLISH_PORT - 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 - name: LOG_LEVEL
value: {{ $envAll.Values.conf.prometheus_exporter.log_level | quote }} value: {{ $envAll.Values.conf.prometheus_exporter.log_level | quote }}
- name: SKIPVERIFY - name: SKIPVERIFY

View File

@ -31,7 +31,7 @@ metadata:
spec: spec:
ports: ports:
- name: metrics - 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: selector:
{{ tuple $envAll "prometheus_rabbitmq_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ tuple $envAll "prometheus_rabbitmq_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }} {{- end }}

View File

@ -226,8 +226,6 @@ network:
cluster: "nginx-cluster" cluster: "nginx-cluster"
annotations: annotations:
nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/rewrite-target: /
prometheus_rabbitmq_exporter:
port: 9095
# typically overridden by environmental # typically overridden by environmental
# values, but should include all endpoints # values, but should include all endpoints