Add configurable serviceMonitor metricRelabelling and targetLabels

Signed-off-by: Calvin Bui <3604363+calvinbui@users.noreply.github.com>
This commit is contained in:
Calvin Bui 2020-08-19 12:25:57 +10:00
parent 6cfab1f1b4
commit bca7b8b217
No known key found for this signature in database
GPG key ID: 7CE1A3592DA0F6FB
3 changed files with 12 additions and 1 deletions

View file

@ -19,12 +19,21 @@ spec:
{{- if .Values.controller.metrics.serviceMonitor.honorLabels }}
honorLabels: true
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
{{ else }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
targetLabels:
{{- range .Values.controller.metrics.serviceMonitor.targetLabels }}
- {{ . }}
{{- end }}
{{- end }}
selector:
matchLabels: