{{- if .Capabilities.APIVersions.Has "operator.victoriametrics.com/v1beta1" }}
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMPodScrape
metadata:
  name: linstor-satellite
  namespace: cozy-linstor
spec:
  podMetricsEndpoints:
  - port: prometheus
    scheme: http
    relabelConfigs:
    - action: labeldrop
      regex: (endpoint|namespace|pod|container)
    - replacement: linstor-controller
      targetLabel: job
    - sourceLabels: [__meta_kubernetes_pod_node_name]
      targetLabel: node
    - targetLabel: tier
      replacement: cluster
  selector:
    matchLabels:
      app.kubernetes.io/component: linstor-satellite
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMPodScrape
metadata:
  name: linstor-controller
  namespace: cozy-linstor
spec:
  podMetricsEndpoints:
  - path: /metrics
    port: api
    scheme: http
    relabelConfigs:
    - action: labeldrop
      regex: (endpoint|namespace|pod|container)
    - replacement: linstor-satellite
      targetLabel: job
    - sourceLabels: [__meta_kubernetes_pod_node_name]
      targetLabel: node
    - targetLabel: tier
      replacement: cluster
  selector:
    matchLabels:
      app.kubernetes.io/component: linstor-controller
{{- end }}
