Skip to content

Commit

Permalink
Merge pull request kubernetes#6039 from calvinbui/master
Browse files Browse the repository at this point in the history
Add configurable serviceMonitor metricRelabelling and targetLabels
  • Loading branch information
k8s-ci-robot authored Aug 24, 2020
2 parents 39db937 + bca7b8b commit a00c7a7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/ingress-nginx/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions charts/ingress-nginx/templates/controller-servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions charts/ingress-nginx/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,8 @@ controller:
# any: true
scrapeInterval: 30s
# honorLabels: true
targetLabels: []
metricRelabelings: []

prometheusRule:
enabled: false
Expand Down

0 comments on commit a00c7a7

Please sign in to comment.