mirror of https://git.rancher.io/charts
33 lines
1.2 KiB
YAML
33 lines
1.2 KiB
YAML
{{- if and .Values.grafana.enabled .Values.grafana.serviceMonitor.selfMonitor }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-grafana
|
|
namespace: {{ template "kube-prometheus-stack.namespace" . }}
|
|
labels:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-grafana
|
|
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: grafana
|
|
app.kubernetes.io/instance: {{ $.Release.Name | quote }}
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ printf "%s" (include "kube-prometheus-stack.namespace" .) | quote }}
|
|
endpoints:
|
|
- port: {{ .Values.grafana.service.portName }}
|
|
{{- if .Values.grafana.serviceMonitor.interval }}
|
|
interval: {{ .Values.grafana.serviceMonitor.interval }}
|
|
{{- end }}
|
|
path: "/metrics"
|
|
{{- if .Values.grafana.serviceMonitor.metricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.grafana.serviceMonitor.metricRelabelings | indent 6) . }}
|
|
{{- end }}
|
|
{{- if .Values.grafana.serviceMonitor.relabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.grafana.serviceMonitor.relabelings | indent 6 }}
|
|
{{- end }}
|
|
{{- end }}
|