@@ -3,51 +3,48 @@ apiVersion: monitoring.coreos.com/v1
3
3
kind : ServiceMonitor
4
4
metadata :
5
5
name : {{ include "ingress-nginx.controller.fullname" . }}
6
- {{- if .Values.controller.metrics.serviceMonitor.namespace }}
6
+ {{- if .Values.controller.metrics.serviceMonitor.namespace }}
7
7
namespace : {{ .Values.controller.metrics.serviceMonitor.namespace }}
8
- {{- else }}
8
+ {{- else }}
9
9
namespace : {{ include "ingress-nginx.namespace" . }}
10
- {{- end }}
10
+ {{- end }}
11
11
labels :
12
12
{{- include "ingress-nginx.labels" . | nindent 4 }}
13
13
app.kubernetes.io/component : controller
14
- {{- if .Values.controller.metrics.serviceMonitor.additionalLabels }}
14
+ {{- if .Values.controller.metrics.serviceMonitor.additionalLabels }}
15
15
{{- toYaml .Values.controller.metrics.serviceMonitor.additionalLabels | nindent 4 }}
16
- {{- end }}
16
+ {{- end }}
17
17
{{- if .Values.controller.metrics.serviceMonitor.annotations }}
18
18
annotations : {{ toYaml .Values.controller.metrics.serviceMonitor.annotations | nindent 4 }}
19
19
{{- end }}
20
20
spec :
21
+ {{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
22
+ namespaceSelector : {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
23
+ {{- else }}
24
+ namespaceSelector :
25
+ matchNames :
26
+ - {{ include "ingress-nginx.namespace" . }}
27
+ {{- end }}
28
+ selector :
29
+ matchLabels :
30
+ {{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
31
+ app.kubernetes.io/component : controller
21
32
endpoints :
22
- - port : {{ .Values.controller.metrics.portName }}
23
- interval : {{ .Values.controller.metrics.serviceMonitor.scrapeInterval }}
33
+ - port : {{ .Values.controller.metrics.portName }}
34
+ interval : {{ .Values.controller.metrics.serviceMonitor.scrapeInterval }}
24
35
{{- if .Values.controller.metrics.serviceMonitor.honorLabels }}
25
- honorLabels : true
36
+ honorLabels : true
26
37
{{- end }}
27
38
{{- if .Values.controller.metrics.serviceMonitor.relabelings }}
28
- relabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.relabelings | nindent 8 }}
39
+ relabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.relabelings | nindent 4 }}
29
40
{{- end }}
30
41
{{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }}
31
- metricRelabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 8 }}
42
+ metricRelabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 4 }}
32
43
{{- end }}
33
- {{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
44
+ {{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
34
45
jobLabel : {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
35
- {{- end }}
36
- {{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
37
- namespaceSelector : {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
38
- {{- else }}
39
- namespaceSelector :
40
- matchNames :
41
- - {{ include "ingress-nginx.namespace" . }}
42
- {{- end }}
43
- {{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
44
- targetLabels :
45
- {{- range .Values.controller.metrics.serviceMonitor.targetLabels }}
46
- - {{ . }}
47
46
{{- end }}
48
- {{- end }}
49
- selector :
50
- matchLabels :
51
- {{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
52
- app.kubernetes.io/component : controller
47
+ {{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
48
+ targetLabels : {{ toYaml .Values.controller.metrics.serviceMonitor.targetLabels | nindent 2 }}
49
+ {{- end }}
53
50
{{- end }}
0 commit comments