From 979349b96fa92d90d2ee837edab68048a4f5c4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Sch=C3=B6rgers?= Date: Tue, 15 Sep 2020 17:25:35 +0200 Subject: [PATCH] [prometheus-nut-exporter] Fix selector (#52) * [prometheus-nut-exporter] Fix selector * [prometheus-nut-exporter] Add tests * Remove tests because no serviceMonitor in pipeline --- charts/prometheus-nut-exporter/Chart.yaml | 2 +- charts/prometheus-nut-exporter/templates/NOTES.txt | 2 +- charts/prometheus-nut-exporter/templates/servicemonitor.yaml | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/prometheus-nut-exporter/Chart.yaml b/charts/prometheus-nut-exporter/Chart.yaml index b1a88e34..36bdfc0d 100644 --- a/charts/prometheus-nut-exporter/Chart.yaml +++ b/charts/prometheus-nut-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: prometheus-nut-exporter description: A Helm chart for Kubernetes type: application -version: 1.0.0 +version: 1.0.1 appVersion: 1.0.1 keywords: - nut diff --git a/charts/prometheus-nut-exporter/templates/NOTES.txt b/charts/prometheus-nut-exporter/templates/NOTES.txt index ea3d3694..0bf4fc52 100644 --- a/charts/prometheus-nut-exporter/templates/NOTES.txt +++ b/charts/prometheus-nut-exporter/templates/NOTES.txt @@ -11,5 +11,5 @@ {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "prometheus-nut-exporter.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") echo "Visit http://127.0.0.1:8080 to use your application" - kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80 + kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:{{ .Values.service.port }} {{- end }} diff --git a/charts/prometheus-nut-exporter/templates/servicemonitor.yaml b/charts/prometheus-nut-exporter/templates/servicemonitor.yaml index 11f1359f..6d4837aa 100644 --- a/charts/prometheus-nut-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-nut-exporter/templates/servicemonitor.yaml @@ -7,7 +7,8 @@ metadata: {{- include "prometheus-nut-exporter.labels" . | nindent 4 }} spec: selector: - {{- include "prometheus-nut-exporter.selectorLabels" . | nindent 4 }} + matchLabels: + {{- include "prometheus-nut-exporter.selectorLabels" . | nindent 6 }} endpoints: {{- range .Values.serviceMonitor.targets }} - port: http