mirror of https://git.rancher.io/charts
43 lines
1.8 KiB
YAML
43 lines
1.8 KiB
YAML
|
{{- if and .Values.prometheus.enabled .Values.prometheus.serviceMonitor.selfMonitor }}
|
||
|
apiVersion: monitoring.coreos.com/v1
|
||
|
kind: ServiceMonitor
|
||
|
metadata:
|
||
|
name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus
|
||
|
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
||
|
labels:
|
||
|
app: {{ template "kube-prometheus-stack.name" . }}-prometheus
|
||
|
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
||
|
spec:
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: {{ template "kube-prometheus-stack.name" . }}-prometheus
|
||
|
release: {{ $.Release.Name | quote }}
|
||
|
self-monitor: "true"
|
||
|
namespaceSelector:
|
||
|
matchNames:
|
||
|
- {{ printf "%s" (include "kube-prometheus-stack.namespace" .) | quote }}
|
||
|
endpoints:
|
||
|
- port: {{ .Values.prometheus.prometheusSpec.portName }}
|
||
|
{{- if .Values.prometheus.serviceMonitor.interval }}
|
||
|
interval: {{ .Values.prometheus.serviceMonitor.interval }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.prometheus.serviceMonitor.scheme }}
|
||
|
scheme: {{ .Values.prometheus.serviceMonitor.scheme }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.prometheus.serviceMonitor.tlsConfig }}
|
||
|
tlsConfig: {{ toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.prometheus.serviceMonitor.bearerTokenFile }}
|
||
|
bearerTokenFile: {{ .Values.prometheus.serviceMonitor.bearerTokenFile }}
|
||
|
{{- end }}
|
||
|
path: "{{ trimSuffix "/" .Values.prometheus.prometheusSpec.routePrefix }}/metrics"
|
||
|
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
|
||
|
metricRelabelings:
|
||
|
{{ tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | indent 6) . }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.prometheus.serviceMonitor.relabelings }}
|
||
|
relabelings:
|
||
|
{{ toYaml .Values.prometheus.serviceMonitor.relabelings | indent 6 }}
|
||
|
{{- end }}
|
||
|
{{- end }}
|