[prometheus-nut-exporter] Fix selector (#52)

* [prometheus-nut-exporter] Fix selector

* [prometheus-nut-exporter] Add tests

* Remove tests because no serviceMonitor in pipeline
This commit is contained in:
Bernd Schörgers 2020-09-15 17:25:35 +02:00 committed by GitHub
parent 521d473cc0
commit 979349b96f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: prometheus-nut-exporter name: prometheus-nut-exporter
description: A Helm chart for Kubernetes description: A Helm chart for Kubernetes
type: application type: application
version: 1.0.0 version: 1.0.1
appVersion: 1.0.1 appVersion: 1.0.1
keywords: keywords:
- nut - nut

View File

@ -11,5 +11,5 @@
{{- else if contains "ClusterIP" .Values.service.type }} {{- 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}") 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" 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 }} {{- end }}

View File

@ -7,7 +7,8 @@ metadata:
{{- include "prometheus-nut-exporter.labels" . | nindent 4 }} {{- include "prometheus-nut-exporter.labels" . | nindent 4 }}
spec: spec:
selector: selector:
{{- include "prometheus-nut-exporter.selectorLabels" . | nindent 4 }} matchLabels:
{{- include "prometheus-nut-exporter.selectorLabels" . | nindent 6 }}
endpoints: endpoints:
{{- range .Values.serviceMonitor.targets }} {{- range .Values.serviceMonitor.targets }}
- port: http - port: http