mirror of https://git.rancher.io/charts
152 lines
5.6 KiB
YAML
152 lines
5.6 KiB
YAML
{{- if .Values.kubelet.enabled }}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ template "kube-prometheus-stack.fullname" . }}-kubelet
|
|
namespace: {{ .Values.kubelet.namespace }}
|
|
labels:
|
|
app: {{ template "kube-prometheus-stack.name" . }}-kubelet
|
|
{{- include "kube-prometheus-stack.labels" . | indent 4 }}
|
|
spec:
|
|
endpoints:
|
|
{{- if .Values.kubelet.serviceMonitor.https }}
|
|
- port: https-metrics
|
|
scheme: https
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
tlsConfig:
|
|
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
insecureSkipVerify: true
|
|
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
honorLabels: true
|
|
{{- if .Values.kubelet.serviceMonitor.metricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.metricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.relabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.relabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisor }}
|
|
- port: https-metrics
|
|
scheme: https
|
|
path: /metrics/cadvisor
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
|
|
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
tlsConfig:
|
|
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
insecureSkipVerify: true
|
|
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisorRelabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.cAdvisorRelabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.probes }}
|
|
- port: https-metrics
|
|
scheme: https
|
|
path: /metrics/probes
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
tlsConfig:
|
|
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
insecureSkipVerify: true
|
|
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
{{- if .Values.kubelet.serviceMonitor.probesMetricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.probesMetricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.probesRelabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.probesRelabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.resource }}
|
|
- port: https-metrics
|
|
scheme: https
|
|
path: {{ .Values.kubelet.serviceMonitor.resourcePath }}
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
tlsConfig:
|
|
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
|
|
insecureSkipVerify: true
|
|
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
|
|
{{- if .Values.kubelet.serviceMonitor.resourceMetricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.resourceMetricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.resourceRelabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.resourceRelabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- else }}
|
|
- port: http-metrics
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
{{- if .Values.kubelet.serviceMonitor.metricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.metricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.relabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.relabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisor }}
|
|
- port: http-metrics
|
|
path: /metrics/cadvisor
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.cAdvisorRelabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.cAdvisorRelabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.resource }}
|
|
- port: http-metrics
|
|
path: {{ .Values.kubelet.serviceMonitor.resourcePath }}
|
|
{{- if .Values.kubelet.serviceMonitor.interval }}
|
|
interval: {{ .Values.kubelet.serviceMonitor.interval }}
|
|
{{- end }}
|
|
honorLabels: true
|
|
{{- if .Values.kubelet.serviceMonitor.resourceMetricRelabelings }}
|
|
metricRelabelings:
|
|
{{ tpl (toYaml .Values.kubelet.serviceMonitor.resourceMetricRelabelings | indent 4) . }}
|
|
{{- end }}
|
|
{{- if .Values.kubelet.serviceMonitor.resourceRelabelings }}
|
|
relabelings:
|
|
{{ toYaml .Values.kubelet.serviceMonitor.resourceRelabelings | indent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
jobLabel: k8s-app
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ .Values.kubelet.namespace }}
|
|
selector:
|
|
matchLabels:
|
|
k8s-app: kubelet
|
|
{{- end}}
|