{{- range .Values.metricsStorages }}
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
  name: vminsert-{{ .name }}
spec:
  endpoints:
  - path: /metrics
    port: http
    relabelConfigs:
    - sourceLabels: [__meta_kubernetes_pod_node_name]
      targetLabel: node
  selector:
    matchLabels:
      app.kubernetes.io/component: monitoring
      app.kubernetes.io/instance: {{ .name }}
      app.kubernetes.io/name: vminsert
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
  name: vmselect-{{ .name }}
spec:
  endpoints:
  - path: /metrics
    port: http
    relabelConfigs:
    - sourceLabels: [__meta_kubernetes_pod_node_name]
      targetLabel: node
  selector:
    matchLabels:
      app.kubernetes.io/component: monitoring
      app.kubernetes.io/instance: {{ .name }}
      app.kubernetes.io/name: vmselect
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
  name: vmstorage-{{ .name }}
spec:
  endpoints:
  - path: /metrics
    port: http
    relabelConfigs:
    - sourceLabels: [__meta_kubernetes_pod_node_name]
      targetLabel: node
  selector:
    matchLabels:
      app.kubernetes.io/component: monitoring
      app.kubernetes.io/instance: {{ .name }}
      app.kubernetes.io/name: vmstorage
{{- end }}
