mirror of https://git.rancher.io/charts
45 lines
1.7 KiB
YAML
45 lines
1.7 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:
|
|
{{- if .Values.prometheusOperator.tls.enabled }}
|
|
- port: https
|
|
scheme: https
|
|
tlsConfig:
|
|
serverName: {{ template "kube-prometheus-stack.operator.fullname" . }}
|
|
ca:
|
|
secret:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-admission
|
|
key: {{ if .Values.prometheusOperator.admissionWebhooks.certManager.enabled }}ca.crt{{ else }}ca{{ end }}
|
|
optional: false
|
|
{{- else }}
|
|
- port: http
|
|
{{- end }}
|
|
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 }}
|