Chart: Rework ServiceMonitor. (#12270)
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
parent
d2b5d90ae1
commit
72e7483831
1 changed files with 26 additions and 29 deletions
|
@ -18,36 +18,33 @@ metadata:
|
||||||
annotations: {{ toYaml .Values.controller.metrics.serviceMonitor.annotations | nindent 4 }}
|
annotations: {{ toYaml .Values.controller.metrics.serviceMonitor.annotations | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
endpoints:
|
|
||||||
- port: {{ .Values.controller.metrics.portName }}
|
|
||||||
interval: {{ .Values.controller.metrics.serviceMonitor.scrapeInterval }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.honorLabels }}
|
|
||||||
honorLabels: true
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.relabelings }}
|
|
||||||
relabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.relabelings | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }}
|
|
||||||
metricRelabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
|
|
||||||
jobLabel: {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
|
{{- if .Values.controller.metrics.serviceMonitor.namespaceSelector }}
|
||||||
namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
|
namespaceSelector: {{ toYaml .Values.controller.metrics.serviceMonitor.namespaceSelector | nindent 4 }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
namespaceSelector:
|
namespaceSelector:
|
||||||
matchNames:
|
matchNames:
|
||||||
- {{ include "ingress-nginx.namespace" . }}
|
- {{ include "ingress-nginx.namespace" . }}
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
|
|
||||||
targetLabels:
|
|
||||||
{{- range .Values.controller.metrics.serviceMonitor.targetLabels }}
|
|
||||||
- {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
|
{{- include "ingress-nginx.selectorLabels" . | nindent 6 }}
|
||||||
app.kubernetes.io/component: controller
|
app.kubernetes.io/component: controller
|
||||||
|
endpoints:
|
||||||
|
- port: {{ .Values.controller.metrics.portName }}
|
||||||
|
interval: {{ .Values.controller.metrics.serviceMonitor.scrapeInterval }}
|
||||||
|
{{- if .Values.controller.metrics.serviceMonitor.honorLabels }}
|
||||||
|
honorLabels: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.controller.metrics.serviceMonitor.relabelings }}
|
||||||
|
relabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.relabelings | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.controller.metrics.serviceMonitor.metricRelabelings }}
|
||||||
|
metricRelabelings: {{ toYaml .Values.controller.metrics.serviceMonitor.metricRelabelings | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.controller.metrics.serviceMonitor.jobLabel }}
|
||||||
|
jobLabel: {{ .Values.controller.metrics.serviceMonitor.jobLabel | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.controller.metrics.serviceMonitor.targetLabels }}
|
||||||
|
targetLabels: {{ toYaml .Values.controller.metrics.serviceMonitor.targetLabels | nindent 2 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in a new issue