-
Notifications
You must be signed in to change notification settings - Fork 286
Expand file tree
/
Copy pathservicemonitor.yaml
More file actions
54 lines (54 loc) · 1.75 KB
/
Copy pathservicemonitor.yaml
File metadata and controls
54 lines (54 loc) · 1.75 KB
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
50
51
52
53
54
{{- if and .Values.prometheus.operator.enabled .Values.prometheus.operator.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ .Values.operator.name }}
{{- with $.Values.additionalAnnotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- include "keda.labels" . | nindent 4 }}
{{- range $key, $value := .Values.prometheus.operator.serviceMonitor.additionalLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.namespace }}
namespace: {{ . }}
{{- end }}
spec:
{{- with .Values.prometheus.operator.serviceMonitor.jobLabel }}
jobLabel: {{ . }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.targetLabels }}
targetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.podTargetLabels }}
podTargetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: {{ .Values.prometheus.operator.serviceMonitor.port }}
{{- with .Values.prometheus.operator.serviceMonitor.targetPort }}
targetPort: {{ . }}
{{- end }}
honorLabels: true
path: /metrics
{{- with .Values.prometheus.operator.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with .Values.prometheus.operator.serviceMonitor.relabellings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Values.operator.name }}
{{- end }}