node-exporter: use endpoints section and lookups to set port

This PS moves node-exporter to use the endpoints section and
lookups to set the ports it serves on.

Change-Id: Id6d71b12e531375e792384ac4410bce74170d033
This commit is contained in:
Steve Wilkerson 2018-03-05 10:44:16 -06:00
parent 0b3307769e
commit 173c4a73ac
3 changed files with 4 additions and 10 deletions

View File

@ -65,8 +65,8 @@ spec:
- --collector.mountstats
ports:
- name: metrics
containerPort: {{ .Values.network.node_exporter.port }}
hostPort: {{ .Values.network.node_exporter.port }}
containerPort: {{ tuple "node_metrics" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
hostPort: {{ tuple "node_metrics" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ tuple $envAll $envAll.Values.pod.resources.node_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
volumeMounts:
- name: proc

View File

@ -33,8 +33,8 @@ spec:
clusterIP: None
ports:
- name: metrics
port: {{ .Values.network.node_exporter.port }}
targetPort: {{ .Values.network.node_exporter.port }}
port: {{ tuple "node_metrics" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
targetPort: {{ tuple "node_metrics" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "node_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

View File

@ -103,10 +103,6 @@ monitoring:
node_exporter:
scrape: true
network:
node_exporter:
port: 9100
endpoints:
cluster_domain_suffix: cluster.local
local_image_registry:
@ -134,8 +130,6 @@ endpoints:
port:
metrics:
default: 9100
prometheus_port:
default: 9100
manifests:
configmap_bin: true