blob: 95bbad6f2d3d3a40bdce8894be7d93b005cf9159 [file] [log] [blame]
Oleksandr K.88f72a22024-07-25 14:03:19 +02001{{- if .Values.serviceMonitor.enabled }}
2apiVersion: monitoring.coreos.com/v1
3kind: ServiceMonitor
4metadata:
5 name: {{ include "goldpinger.fullname" . }}
6 {{- if .Values.serviceMonitor.namespace }}
7 namespace: {{ .Values.serviceMonitor.namespace }}
8 {{- end }}
9 labels:
10 {{- include "goldpinger.labels" . | nindent 4 }}
11 {{- range $key, $value := .Values.serviceMonitor.selector }}
12 {{ $key }}: {{ $value | quote }}
13 {{- end }}
14spec:
15 endpoints:
16 - port: http
17 interval: {{ .Values.serviceMonitor.interval }}
18 {{- if .Values.serviceMonitor.honorLabels }}
19 honorLabels: true
20 {{- end }}
21 jobLabel: name
22 namespaceSelector:
23 matchNames:
24 - {{ .Release.Namespace }}
25 selector:
26 matchLabels:
27 {{- include "goldpinger.selectorLabels" . | nindent 6 }}
28{{- end -}}