Skip to content

Commit 09946c2

Browse files
feat: Added basic auth support for servicemonitor (#5761)
* Added support for basic auth in servicemonitor * Added support for namespace selector and custom matchLabels * Fixed indentations
1 parent 6da544f commit 09946c2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
{{- if .servicemonitor.scrapeTimeout }}
3939
scrapeTimeout: {{ .servicemonitor.scrapeTimeout}}
4040
{{- end }}
41+
{{- if .servicemonitor.basicAuth }}
42+
basicAuth:
43+
{{- toYaml .servicemonitor.basicAuth | nindent 8 }}
44+
{{- end }}
4145
{{- if .servicemonitor.metricRelabelings}}
4246
metricRelabelings:
4347
{{toYaml .servicemonitor.metricRelabelings | indent 8 }}
@@ -46,7 +50,16 @@ spec:
4650
{{- end }}
4751
{{- end }}
4852
{{- end }}
53+
{{- if .Values.servicemonitor.namespaceSelector }}
54+
namespaceSelector:
55+
matchNames:
56+
{{- toYaml .Values.servicemonitor.namespaceSelector | nindent 6 }}
57+
{{- end }}
4958
selector:
5059
matchLabels:
60+
{{- if .Values.servicemonitor.matchLabels }}
61+
{{- toYaml .Values.servicemonitor.matchLabels | nindent 6 }}
62+
{{- else }}
5163
app: {{ template ".Chart.Name .name" $ }}
64+
{{- end }}
5265
{{- end }}

0 commit comments

Comments
 (0)