servicemonitor.yaml 861 B

123456789101112131415161718192021222324252627282930
  1. {{- if .Values.serviceMonitor.enabled }}
  2. ---
  3. apiVersion: monitoring.coreos.com/v1
  4. kind: ServiceMonitor
  5. metadata:
  6. name: {{ template "elasticsearch-exporter.fullname" . }}
  7. labels:
  8. chart: {{ template "elasticsearch-exporter.chart" . }}
  9. k8s-app: {{ template "elasticsearch-exporter.name" . }}
  10. release: "{{ .Release.Name }}"
  11. heritage: "{{ .Release.Service }}"
  12. {{- if .Values.serviceMonitor.labels }}
  13. {{- toYaml .Values.serviceMonitor.labels | nindent 4 }}
  14. {{- end }}
  15. spec:
  16. endpoints:
  17. - interval: 10s
  18. honorLabels: true
  19. port: http
  20. path: {{ .Values.web.path }}
  21. scheme: http
  22. jobLabel: "{{ .Release.Name }}"
  23. selector:
  24. matchLabels:
  25. k8s-app: {{ template "elasticsearch-exporter.name" . }}
  26. release: "{{ .Release.Name }}"
  27. namespaceSelector:
  28. matchNames:
  29. - {{ .Release.Namespace }}
  30. {{- end }}