kubezero/charts/kubezero-metrics/charts/kube-prometheus-stack/charts/prometheus-node-exporter/templates/servicemonitor.yaml

62 lines
2.1 KiB
YAML
Raw Normal View History

{{- if .Values.prometheus.monitor.enabled }}
2022-10-27 12:27:42 +00:00
apiVersion: {{ .Values.prometheus.monitor.apiVersion | default "monitoring.coreos.com/v1" }}
kind: ServiceMonitor
metadata:
2022-12-06 20:43:11 +00:00
name: {{ include "prometheus-node-exporter.fullname" . }}
namespace: {{ include "prometheus-node-exporter.monitor-namespace" . }}
labels:
{{- include "prometheus-node-exporter.labels" . | nindent 4 }}
{{- with .Values.prometheus.monitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ default "app.kubernetes.io/name" .Values.prometheus.monitor.jobLabel }}
2022-12-06 20:43:11 +00:00
{{- include "servicemonitor.scrapeLimits" .Values.prometheus.monitor | nindent 2 }}
2023-04-14 10:44:57 +00:00
{{- with .Values.prometheus.monitor.podTargetLabels }}
podTargetLabels:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
2022-12-06 20:43:11 +00:00
{{- with .Values.prometheus.monitor.selectorOverride }}
{{- toYaml . | nindent 6 }}
{{- else }}
{{- include "prometheus-node-exporter.selectorLabels" . | nindent 6 }}
{{- end }}
{{- with .Values.prometheus.monitor.attachMetadata }}
attachMetadata:
{{- toYaml . | nindent 4 }}
{{- end }}
endpoints:
- port: {{ .Values.service.portName }}
scheme: {{ .Values.prometheus.monitor.scheme }}
2022-12-06 20:43:11 +00:00
{{- with .Values.prometheus.monitor.basicAuth }}
2022-08-24 15:13:39 +00:00
basicAuth:
{{- toYaml . | nindent 8 }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.bearerTokenFile }}
bearerTokenFile: {{ . }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.proxyUrl }}
proxyUrl: {{ . }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.interval }}
interval: {{ . }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.scrapeTimeout }}
scrapeTimeout: {{ . }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- with .Values.prometheus.monitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
2022-12-06 20:43:11 +00:00
{{- end }}
{{- end }}