Skip to content

Commit

Permalink
feat(helm): add custom selector labels on ServiceMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
Yokann committed Jan 26, 2024
1 parent 9ba8a11 commit 12cb3af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions helm/prescaling-exporter/templates/monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ spec:
matchLabels:
app: {{ template "prescaling-exporter.name" . }}
release: {{ .Release.Name }}
{{- if .Values.prometheus.monitor.additionalSelectorLabels }}
{{- toYaml .Values.prometheus.monitor.selector.additionalSelectorLabels | nindent 4 }}
{{- end }}
endpoints:
- port: metrics
{{- if .Values.prometheus.monitor.scrapeTimeout }}
Expand Down Expand Up @@ -49,4 +52,7 @@ spec:
selector:
matchLabels:
{{- include "prescaling-exporter.selectorLabels" . | nindent 8 }}
{{- if .Values.victoriametrics.monitor.additionalSelectorLabels }}
{{- toYaml .Values.victoriametrics.monitor.additionalSelectorLabels | nindent 4 }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions helm/test-values.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ prometheus:
monitor:
enabled: false
additionalLabels: {}
additionalSelectorLabels: {}
relabelings:
- action: replace
regex: (.*)
Expand All @@ -27,6 +28,7 @@ victoriametrics:
monitor:
enabled: true
additionalLabels: {}
additionalSelectorLabels: {}
relabelings:
- action: replace
regex: (.*)
Expand Down

0 comments on commit 12cb3af

Please sign in to comment.