{{- if index .Values "lvm-localpv" "prometheus" "enabled" }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: {{ printf "%s-%s" (include "kubezero-lib.fullname" $) "openebs-monitoring-lvmlocalpv" | trunc 63 | trimSuffix "-" }}
  namespace: {{ .Release.Namespace }}
  labels:
    {{- include "kubezero-lib.labels" . | nindent 4 }}
spec:
  selector:
    matchLabels:
      name: openebs-lvm-node
  namespaceSelector:
    any: true
  endpoints:
    - port: metrics
      path: /metrics
{{- end }}