apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: vmstack
  namespace: vmstack
spec:
  interval: 5m
  timeout: 20m
  values:
    global:
      clusterLabel: wb
    nameOverride: vmstack
    fullnameOverride: vmstack
    defaultRules:
      create: true
    victoria-metrics-operator:
      admissionWebhooks:
        enabled: false
    vmsingle:
      enabled: true
      spec:
        retentionPeriod: 1w
        replicaCount: 1
        storage:
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 100Gi
          storageClassName: local-path
    vmcluster:
      enabled: false
    vmagent:
      enabled: true
      spec:
        remoteWrite:
          - url: http://vmsingle-vmstack.vmstack.svc.cluster.local.:8428/api/v1/write
    vmalert:
      enabled: true
      spec:
        evaluationInterval: 30s
        extraArgs:
          external.url: https://vmalert-srx.wb.ru
      ingress:
        enabled: false
    alertmanager:
      enabled: true
      spec:
        replicaCount: 1
        externalURL: https://vmalert-srx.wb.ru
        volumes: []
        volumeMounts: []
      config:
        global:
          resolve_timeout: 5m
        route:
          receiver: goalert
          group_by:
            - alertname
            - namespace
            - pod
          group_wait: 30s
          group_interval: 5m
          repeat_interval: 6h
        receivers:
          - name: goalert
            webhook_configs:
              - url: http://goalert.goalert.svc.cluster.local:8081/api/v2/prometheusalertmanager/incoming
                send_resolved: true
    kube-state-metrics:
      enabled: true
    prometheus-node-exporter:
      enabled: false
      vmScrape:
        enabled: false
        spec:
          jobLabel: jobLabel
          selector:
            matchLabels:
              app.kubernetes.io/name: '{{ include "prometheus-node-exporter.name" (index .Subcharts "prometheus-node-exporter") }}'
          endpoints:
            - port: metrics
              relabelConfigs:
                - action: replace
                  sourceLabels:
                    - __meta_kubernetes_pod_node_name
                  targetLabel: node
                - targetLabel: job
                  replacement: vm-stack/vm-prod-node-exporter

              metricRelabelConfigs:
                - action: drop
                  source_labels: [mountpoint]
                  regex: "/var/lib/kubelet/pods.+"
      vmNodeScrape:
        enabled: false
    grafana:
      enabled: false
