Skip to content

Commit a6a2ae2

Browse files
add basic auth and tls for sm (#5789)
1 parent 02f4a1b commit a6a2ae2

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

scripts/devtron-reference-helm-charts/statefulset-chart_5-1-0/templates/servicemonitor.yaml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,50 @@ spec:
2424
{{- range .Values.ContainerPort }}
2525
{{- if .servicemonitor }}
2626
{{- if .servicemonitor.enabled}}
27-
{{- if .servicePort }}
27+
{{- if .servicemonitor.targetPort }}
28+
- targetPort: {{ .servicemonitor.targetPort }}
29+
{{- else if .servicePort }}
2830
- port: {{ .name }}
31+
{{- end }}
32+
{{- if .servicemonitor.path }}
33+
path: {{ .servicemonitor.path}}
34+
{{- end }}
35+
{{- if .servicemonitor.scheme }}
36+
scheme: {{ .servicemonitor.scheme}}
37+
{{- end }}
38+
{{- if .servicemonitor.interval }}
39+
interval: {{ .servicemonitor.interval}}
40+
{{- end }}
41+
{{- if .servicemonitor.scrapeTimeout }}
42+
scrapeTimeout: {{ .servicemonitor.scrapeTimeout}}
43+
{{- end }}
44+
{{- if .servicemonitor.basicAuth }}
45+
basicAuth:
46+
{{- toYaml .servicemonitor.basicAuth | nindent 8 }}
47+
{{- end }}
48+
{{- if .servicemonitor.insecureTLS }}
49+
tlsConfig:
50+
insecureSkipVerify: true
51+
{{- else if .servicemonitor.tlsConfig }}
52+
tlsConfig:
53+
{{- toYaml .servicemonitor.tlsConfig | nindent 8 }}
54+
{{- end }}
55+
{{- if .servicemonitor.metricRelabelings}}
56+
metricRelabelings:
57+
{{toYaml .servicemonitor.metricRelabelings | indent 8 }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}
62+
{{- range .Values.containers }}
63+
{{- range .ports }}
64+
{{- if .servicemonitor }}
65+
{{- if .servicemonitor.enabled}}
66+
{{- if .servicemonitor.targetPort }}
67+
- targetPort: {{ .servicemonitor.targetPort }}
68+
{{- else if .servicePort }}
69+
- port: {{ .name }}
70+
{{- end }}
2971
{{- if .servicemonitor.path }}
3072
path: {{ .servicemonitor.path}}
3173
{{- end }}
@@ -42,6 +84,13 @@ spec:
4284
basicAuth:
4385
{{- toYaml .servicemonitor.basicAuth | nindent 8 }}
4486
{{- end }}
87+
{{- if .servicemonitor.insecureTLS }}
88+
tlsConfig:
89+
insecureSkipVerify: true
90+
{{- else if .servicemonitor.tlsConfig }}
91+
tlsConfig:
92+
{{- toYaml .servicemonitor.tlsConfig | nindent 8 }}
93+
{{- end }}
4594
{{- if .servicemonitor.metricRelabelings}}
4695
metricRelabelings:
4796
{{toYaml .servicemonitor.metricRelabelings | indent 8 }}

0 commit comments

Comments
 (0)