storageClass:
  enabled: true
  name: vmcluster-storage
  provisioner: disk.csi.azure.com
  parameters:
    kind: Managed
    fsType: ext4
    skuName: PremiumV2_LRS
    DiskIOPSReadWrite: '3000'
    DiskMBpsReadWrite: '125'
  reclaimPolicy: Delete
  volumeBindingMode: WaitForFirstConsumer
  allowVolumeExpansion: true
serviceAccount:
  annotations:
    azure.workload.identity/client-id: TMPL_VMCLUSTER_ROLE
vmbackup:
  enabled: true
  mode: manager
  image: TMPL_IMAGE_REGISTRY/observability/vmbackupmanager:f82e69ce98fb871f5996a1f9ea92e4480943b68c
  resources:
    requests:
      cpu: '0.05'
      memory: 20Mi
    limits:
      cpu: '0.5'
      memory: 1Gi
  imagePullPolicy: Always
  vendor: azure
  dst: azblob://TMPL_VMCLUSTER_BUCKET_NAME/1/vmcluster/$(MY_POD_NAME)
  backupRetention: 1y
  maxBytesPerSecond: '262144000'
  extraEnv:
  - name: AZURE_STORAGE_ACCOUNT_NAME
    value: TMPL_STORAGE_ACCOUNT_NAME
  - name: AZURE_USE_DEFAULT_CREDENTIAL
    value: 'true'
vmcluster:
  name: vmcluster
  namespace: observability
  spec:
    replicationFactor: 2
    retentionPeriod: '3'
    vminsert:
      extraArgs:
        maxLabelsPerTimeseries: '100'
        maxConcurrentInserts: '8'
        maxLabelValueLen: '16384'
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - vminsert
              topologyKey: kubernetes.io/hostname
            weight: 100
      image:
        repository: TMPL_IMAGE_REGISTRY/victoriametrics/vminsert
        tag: v1.122.2-cluster-hotfix-20260305
      podMetadata:
        labels:
          owner: infra
      replicaCount: 2
      resources:
        limits:
          cpu: 625m
          memory: 1.25Gi
        requests:
          cpu: 500m
          memory: 1Gi
      nodeSelector:
        node_type: worker
      hpa:
        minReplicas: 2
        maxReplicas: 4
        metrics:
        - type: Resource
          resource:
            name: cpu
            target:
              type: Utilization
              averageUtilization: 80
        - type: Resource
          resource:
            name: memory
            target:
              type: Utilization
              averageUtilization: 90
        behaviour:
          scaleUp:
            stabilizationWindowSeconds: 60
          scaleDown:
            stabilizationWindowSeconds: 600
            policies:
            - type: Pods
              value: 1
              periodSeconds: 300
    vmselect:
      persistentVolumeClaimRetentionPolicy:
        whenDeleted: Delete
        whenScaled: Delete
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - vmselect
              topologyKey: kubernetes.io/hostname
            weight: 100
      cacheMountPath: /select-cache
      extraArgs:
        search.skipSlowReplicas: 'true'
        search.maxConcurrentRequests: '10'
        search.logQueryMemoryUsage: 500MiB
      image:
        repository: TMPL_IMAGE_REGISTRY/victoriametrics/vmselect
        tag: v1.122.2-cluster-hotfix-20260305
      podMetadata:
        labels:
          owner: infra
      replicaCount: 2
      resources:
        limits:
          cpu: 750m
          memory: 1.5Gi
        requests:
          cpu: 500m
          memory: 1Gi
      storage:
        volumeClaimTemplate:
          metadata: {}
          spec:
            resources:
              requests:
                storage: 10Gi
          status: {}
      hpa:
        minReplicas: 2
        maxReplicas: 4
        metrics:
        - type: Resource
          resource:
            name: cpu
            target:
              type: Utilization
              averageUtilization: 90
        - type: Resource
          resource:
            name: memory
            target:
              type: Utilization
              averageUtilization: 90
        behaviour:
          scaleUp:
            stabilizationWindowSeconds: 60
          scaleDown:
            stabilizationWindowSeconds: 600
            policies:
            - type: Pods
              value: 1
              periodSeconds: 300
      nodeSelector:
        node_type: worker
    vmstorage:
      topologySpreadConstraints:
      - maxSkew: 1
        topologyKey: kubernetes.io/hostname
        whenUnsatisfiable: ScheduleAnyway
        labelSelector:
          matchLabels:
            app.kubernetes.io/name: vmstorage
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchExpressions:
                - key: app.kubernetes.io/name
                  operator: In
                  values:
                  - vmstorage
              topologyKey: kubernetes.io/hostname
            weight: 50
      image:
        repository: TMPL_IMAGE_REGISTRY/victoriametrics/vmstorage
        tag: v1.122.2-cluster-hotfix-20260305
      podMetadata:
        labels:
          owner: infra
          azure.workload.identity/use: 'true'
      replicaCount: 3
      resources:
        limits:
          cpu: '1'
          memory: 8Gi
        requests:
          cpu: '0.5'
          memory: 8Gi
      storage:
        volumeClaimTemplate:
          metadata: {}
          spec:
            resources:
              requests:
                storage: 50Gi
          status: {}
      extraArgs:
        storage.vminsertConnsShutdownDuration: 90s
      minReadySeconds: 200
      terminationGracePeriodSeconds: 120
      storageDataPath: /vm-data
      nodeSelector:
        node_type: worker
      containers: []
vmalert:
  enabled: true
  name: vmalert-shared
  namespace: observability
  spec:
    containers:
    - name: config-reloader
      resources:
        limits:
          cpu: 10m
          memory: 32Mi
        requests:
          cpu: 10m
          memory: 32Mi
    datasource:
      url: http://vmselect-vmcluster.observability.svc.cluster.local:8481/select/multitenant/prometheus
    image:
      repository: TMPL_IMAGE_REGISTRY/victoriametrics/vmalert
      tag: v1.122.2-cluster-hotfix-20260305
    livenessProbe:
      initialDelaySeconds: 30
    notifiers:
    - url: http://alertmanager-alert-regional-0.alertmanager-operated.default.svc.cluster.local:9093
    - url: http://alertmanager-alert-regional-1.alertmanager-operated.default.svc.cluster.local:9093
    readinessProbe:
      initialDelaySeconds: 30
    remoteRead:
      url: http://vmselect-vmcluster.observability.svc.cluster.local:8481/select/multitenant/prometheus
    remoteWrite:
      url: http://vminsert-vmcluster.observability.svc.cluster.local:8480/insert/multitenant/prometheus
      maxBatchSize: 5000
    resources:
      limits:
        cpu: '1'
        memory: 1Gi
      requests:
        cpu: 200m
        memory: 256Mi
    nodeSelector:
      node_type: worker
    ruleNamespaceSelector:
      matchExpressions:
      - key: observability.pingcap.com/bizType
        operator: In
        values:
        - tidbcloud
        - staging-tidbcloud
        - staging-tidbcloud-nextgen
        - dev-tidbcloud-nextgen
        - prod-tidbcloud-nextgen
        - byoc
      - key: observability.pingcap.com/rule-multi-tenancy
        operator: In
        values:
        - 'true'
    ruleSelector:
      matchExpressions:
      - key: observability.pingcap.com/rule-multi-tenancy
        operator: In
        values:
        - 'true'
      - key: observability.pingcap.com/cluster-paused
        operator: NotIn
        values:
        - 'true'
      - key: observability.pingcap.com/applicationID
        operator: NotIn
        values:
        - base
        - seed
ingress:
  dataplaneMetricsRead:
    enabled: true
    name: dataplane-metrics-read
    namespace: observability
    annotations:
      nginx.ingress.kubernetes.io/cors-allow-methods: GET,POST
      nginx.ingress.kubernetes.io/cors-allow-origin: "*"
      nginx.ingress.kubernetes.io/enable-cors: "true"
      nginx.ingress.kubernetes.io/use-regex: "true"
      nginx.ingress.kubernetes.io/configuration-snippet: |
        access_by_lua_block {
          local dynamic_route = require("dynamic_route")
          dynamic_route.rewrite_url("useO11yID")
        }
    ingressClassName: TMPL_NGINX_READ_INGRESS_CLASS
    rules:
      - http:
          paths:
            - backend:
                service:
                  name: vmselect-vmcluster
                  port:
                    number: 8481
              path: /([0-9a-fA-F-]{36})/metrics/(api/v1/.+)
              pathType: ImplementationSpecific
  dataplaneInsert:
    enabled: true
    name: o11y-dataplane-insert
    namespace: observability
    annotations:
      nginx.ingress.kubernetes.io/rewrite-target: /insert/multitenant/prometheus/$2
      nginx.ingress.kubernetes.io/use-regex: "true"
    ingressClassName: TMPL_NGINX_WRITE_INGRESS_CLASS
    rules:
      - http:
          paths:
            - backend:
                service:
                  name: vminsert-vmcluster
                  port:
                    number: 8480
              path: /multitenant(/|$)(.*)
              pathType: ImplementationSpecific
  dataplaneReadInternal:
    enabled: true
    name: dataplane-read-internal
    namespace: observability
    annotations:
      nginx.ingress.kubernetes.io/use-regex: "true"
      nginx.ingress.kubernetes.io/configuration-snippet: |
        access_by_lua_block {
          local dynamic_route = require("dynamic_route")
          dynamic_route.rewrite_url("useO11yID")
        }
    ingressClassName: TMPL_NGINX_READ_INGRESS_CLASS
    rules:
      - http:
          paths:
            - backend:
                service:
                  name: vmselect-vmcluster
                  port:
                    number: 8481
              path: /internal/v2/metrics/(.*)/(api/v1/.*)
              pathType: ImplementationSpecific
  dataplaneReadClinicMultitenantInternal:
    enabled: true
    name: dataplane-read-clinic-multitenant-internal
    namespace: observability
    annotations:
      nginx.ingress.kubernetes.io/use-regex: "true"
      nginx.ingress.kubernetes.io/rewrite-target: /select/multitenant/prometheus/$1
    ingressClassName: TMPL_NGINX_READ_INGRESS_CLASS
    rules:
      - http:
          paths:
            - backend:
                service:
                  name: vmselect-vmcluster
                  port:
                    number: 8481
              path: /internal/v2/metrics/multitenant/(.*)
              pathType: ImplementationSpecific
