forked from kubegems/appstore-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservicemonitor.yaml
49 lines (49 loc) · 1.67 KB
/
servicemonitor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{{- if .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "prometheus-mysql-exporter.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "prometheus-mysql-exporter.labels" . | nindent 4 }}
{{- if .Values.serviceMonitor.additionalLabels }}
{{ toYaml .Values.serviceMonitor.additionalLabels | indent 4 }}
{{- end }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "prometheus-mysql-exporter.selectorLabels" . | nindent 6 }}
{{- with .Values.serviceMonitor.jobLabel }}
jobLabel: {{ . | quote}}
{{- end }}
{{- with .Values.serviceMonitor.targetLabels }}
targetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
{{- with .Values.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{ toYaml . | trim | indent 4 -}}
{{- end }}
endpoints:
- path: {{ .Values.serviceMonitor.path }}
scheme: {{ .Values.serviceMonitor.scheme }}
port: {{ .Values.service.name }}
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml .Values.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if .Values.serviceMonitor.relabelings }}
relabelings: {{ toYaml .Values.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
{{- end }}