From 611f050e87bbd6ecbbec4f8ef5ff2f4d9a7cfdd1 Mon Sep 17 00:00:00 2001 From: rmakram-ims <43446736+rmakram-ims@users.noreply.github.com> Date: Mon, 17 Dec 2018 15:00:28 -0500 Subject: [PATCH] [stable/prometheus-node-exporter]Add support for nodePort (#9754) * [stable/prometheus-node-exporter]Add support for nodePort Signed-off-by: Roger Makram * bump version to 1.0.0 since its stable needed to bump anyways as this isn't really a patch update. Signed-off-by: Paul Czarkowski --- stable/prometheus-node-exporter/Chart.yaml | 2 +- stable/prometheus-node-exporter/README.md | 1 + stable/prometheus-node-exporter/templates/service.yaml | 3 +++ stable/prometheus-node-exporter/values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stable/prometheus-node-exporter/Chart.yaml b/stable/prometheus-node-exporter/Chart.yaml index 61ebb0edc7..478aba49cf 100644 --- a/stable/prometheus-node-exporter/Chart.yaml +++ b/stable/prometheus-node-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.17.0" description: A Helm chart for prometheus node-exporter name: prometheus-node-exporter -version: 0.6.2 +version: 1.0.0 home: https://github.com/prometheus/node_exporter/ sources: - https://github.com/prometheus/node_exporter/ diff --git a/stable/prometheus-node-exporter/README.md b/stable/prometheus-node-exporter/README.md index 74caa90d3d..4bd4b4120b 100644 --- a/stable/prometheus-node-exporter/README.md +++ b/stable/prometheus-node-exporter/README.md @@ -50,6 +50,7 @@ The following table lists the configurable parameters of the Node Exporter chart | `service.type` | Service type | `ClusterIP` | | | `service.port` | The service port | `9100` | | | `service.targetPort` | The target port of the container | `9100` | | +| `service.nodePort` | The node port of the service | | | | `service.annotations` | Kubernetes service annotations | `{prometheus.io/scrape: "true"}` | | | `serviceAccount.create` | Specifies whether a service account should be created. | `true` | | | `serviceAccount.name` | Service account to be used. If not set and `serviceAccount.create` is `true`, a name is generated using the fullname template | | | diff --git a/stable/prometheus-node-exporter/templates/service.yaml b/stable/prometheus-node-exporter/templates/service.yaml index 3bb47956dc..cffe547b10 100644 --- a/stable/prometheus-node-exporter/templates/service.yaml +++ b/stable/prometheus-node-exporter/templates/service.yaml @@ -11,6 +11,9 @@ spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} + {{- if ( and (eq .Values.service.type "NodePort" ) (not (empty .Values.service.nodePort)) ) }} + nodePort: {{ .Values.service.nodePort }} + {{- end }} targetPort: {{ .Values.service.targetPort }} protocol: TCP name: metrics diff --git a/stable/prometheus-node-exporter/values.yaml b/stable/prometheus-node-exporter/values.yaml index 7d3fc76a09..3169424347 100644 --- a/stable/prometheus-node-exporter/values.yaml +++ b/stable/prometheus-node-exporter/values.yaml @@ -10,6 +10,7 @@ service: type: ClusterIP port: 9100 targetPort: 9100 + nodePort: annotations: prometheus.io/scrape: "true"