2021-08-21 20:42:00 +00:00
{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) .Values.controller.metrics.enabled .Values.controller.metrics.serviceMonitor.enabled -}}
2020-02-24 19:25:57 +00:00
apiVersion : monitoring.coreos.com/v1
kind : ServiceMonitor
metadata :
2020-03-04 02:53:23 +00:00
name : {{ include "ingress-nginx.controller.fullname" . }}
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.metrics.serviceMonitor.namespace }}
2021-01-27 21:06:51 +00:00
namespace : {{ .Values.controller.metrics.serviceMonitor.namespace | quote }}
2020-03-02 14:49:26 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
labels :
2020-02-28 14:53:24 +00:00
{{- include "ingress-nginx.labels" . | nindent 4 }}
2020-03-04 02:53:23 +00:00
app.kubernetes.io/component : controller
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.metrics.serviceMonitor.additionalLabels }}
{{- toYaml .Values.controller.metrics.serviceMonitor.additionalLabels | nindent 4 }}
{{- end }}
2020-02-24 19:25:57 +00:00
spec :
endpoints :
- port : metrics
interval : {{ .Values.controller.metrics.serviceMonitor.scrapeInterval }}
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.metrics.serviceMonitor.honorLabels }}
2020-02-24 19:25:57 +00:00
honorLabels : true
2020-03-02 14:49:26 +00:00
{{- end }}
2021-12-06 13:50:32 +00:00
{{- if .Values.controller.metrics.serviceMonitor.relabelings }}
relabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
2020-08-19 02:25:57 +00:00
{{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings : {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 8 }}
{{- end }}
2021-03-10 09:51:55 +00:00
{{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
jobLabel : {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
{{- end }}
2020-03-02 14:49:26 +00:00
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
namespaceSelector : {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
2020-08-19 02:25:57 +00:00
{{- end }}
{{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
targetLabels :
{{- range .Values.controller.metrics.serviceMonitor.targetLabels }}
- {{ . }}
{{- end }}
2020-03-02 14:49:26 +00:00
{{- end }}
2020-02-24 19:25:57 +00:00
selector :
matchLabels :
2020-02-28 14:53:24 +00:00
{{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
2020-03-04 02:53:23 +00:00
app.kubernetes.io/component : controller
2020-02-24 19:25:57 +00:00
{{- end }}