---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMNodeScrape
metadata:
  name: victoria-metrics-operator-probes
  namespace: cozy-monitoring
spec:
  bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
  honorLabels: true
  interval: 30s
  metricRelabelConfigs:
  - action: labeldrop
    regex: (uid)
  - action: labeldrop
    regex: (id|name)
  - action: drop
    regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count)
    source_labels:
    - __name__
  path: /metrics/probes
  relabelConfigs:
  - action: labelmap
    regex: __meta_kubernetes_node_label_(.+)
  - action: labeldrop
    regex: '.*node_kubevirt_io.*'
  - sourceLabels: [__metrics_path__]
    targetLabel: metrics_path
  - replacement: kubelet
    targetLabel: job
  scheme: https
  scrapeTimeout: 5s
  tlsConfig:
    caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecureSkipVerify: true
---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMNodeScrape
metadata:
  name: victoria-metrics-operator-kubelet
  namespace: cozy-monitoring
spec:
  bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
  honorLabels: true
  interval: 30s
  metricRelabelConfigs:
  - action: labeldrop
    regex: (uid)
  - action: labeldrop
    regex: (id|name)
  - action: drop
    regex: (rest_client_request_duration_seconds_bucket|rest_client_request_duration_seconds_sum|rest_client_request_duration_seconds_count)
    source_labels: [__name__]
  relabelConfigs:
  - action: labelmap
    regex: __meta_kubernetes_node_label_(.+)
  - action: labeldrop
    regex: '.*node_kubevirt_io.*'
  - sourceLabels:
    - __metrics_path__
    targetLabel: metrics_path
  - replacement: kubelet
    targetLabel: job
  scheme: https
  scrapeTimeout: 5s
  tlsConfig:
    caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecureSkipVerify: true
