-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathcollector-servicemonitor.yaml
44 lines (44 loc) · 1.64 KB
/
collector-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
{{- if and (.Values.collector.enabled) (.Values.collector.serviceMonitor.enabled)}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "jaeger.collector.name" . }}
{{- if .Values.collector.serviceMonitor.namespace }}
namespace: {{ .Values.collector.serviceMonitor.namespace }}
{{- end }}
labels:
{{- include "jaeger.labels" . | nindent 4 }}
app.kubernetes.io/component: collector
{{- if .Values.collector.serviceMonitor.additionalLabels }}
{{- toYaml .Values.collector.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
{{- if .Values.collector.serviceMonitor.annotations }}
annotations:
{{- toYaml .Values.collector.serviceMonitor.annotations | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: admin
path: /metrics
{{- if .Values.collector.serviceMonitor.interval }}
interval: {{ .Values.collector.serviceMonitor.interval }}
{{- end }}
{{- if .Values.collector.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.collector.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.collector.serviceMonitor.relabelings }}
relabelings:
{{- toYaml .Values.collector.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
{{- if .Values.collector.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml .Values.collector.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/component: collector
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}