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

@ -1,6 +1,6 @@
apiVersion: v1
name: ingress-nginx
version: 2.11.3
version: 2.12.0
appVersion: 0.34.1
home: https://github.com/kubernetes/ingress-nginx
description: Ingress controller for Kubernetes using NGINX as a reverse proxy and load balancer

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:

View file

@ -426,6 +426,8 @@ controller:
# any: true
scrapeInterval: 30s
# honorLabels: true
targetLabels: []
metricRelabelings: []
prometheusRule:
enabled: false