rancher-charts/charts/rancher-monitoring/9.4.202/templates/prometheus-operator/servicemonitor.yaml

33 lines
1.2 KiB
YAML

{{- if and .Values.prometheusOperator.enabled .Values.prometheusOperator.serviceMonitor.selfMonitor }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "kube-prometheus-stack.fullname" . }}-operator
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
app: {{ template "kube-prometheus-stack.name" . }}-operator
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
spec:
endpoints:
- port: http
honorLabels: true
{{- if .Values.prometheusOperator.serviceMonitor.interval }}
interval: {{ .Values.prometheusOperator.serviceMonitor.interval }}
{{- end }}
{{- if .Values.prometheusOperator.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.prometheusOperator.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.prometheusOperator.serviceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.prometheusOperator.serviceMonitor.relabelings | indent 6 }}
{{- end }}
selector:
matchLabels:
app: {{ template "kube-prometheus-stack.name" . }}-operator
release: {{ $.Release.Name | quote }}
namespaceSelector:
matchNames:
- {{ printf "%s" (include "kube-prometheus-stack.namespace" .) | quote }}
{{- end }}