charts/explorer/templates/servicemonitor.yaml
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "explorer.fullname" . }}
labels:
{{- include "explorer.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "explorer.selectorLabels" . | nindent 6 }}
endpoints:
- port: http
path: /metrics
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
jobLabel: app.kubernetes.io/name
{{- end }}