---
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMCluster
metadata:
  name: main
  namespace: observability
spec:
  retentionPeriod: "180d"
  replicationFactor: 2
  vmstorage:
    replicaCount: 2
    extraArgs:
      dedup.minScrapeInterval: 15s
      loggerFormat: json
    storage:
      volumeClaimTemplate:
        spec:
          storageClassName: cephrbd-fast-delete
          accessModes:
            - ReadWriteOnce
          resources:
            requests:
              storage: 200Gi
    resources:
      requests:
        cpu: 250m
        memory: 2Gi
      limits:
        cpu: "2"
        memory: 8Gi
  vmselect:
    replicaCount: 2
    extraArgs:
      dedup.minScrapeInterval: 15s
      loggerFormat: json
    resources:
      requests:
        cpu: 50m
        memory: 128Mi
      limits:
        cpu: 500m
        memory: 1024Mi
    hpa:
      minReplicas: 2
      maxReplicas: 10
      metrics:
        - type: Resource
          resource:
            name: cpu
            target:
              type: Utilization
              averageUtilization: 60
      behavior:
        scaleUp:
          stabilizationWindowSeconds: 0
          selectPolicy: Max
          policies:
            - type: Percent
              value: 100
              periodSeconds: 30
            - type: Pods
              value: 4
              periodSeconds: 30
        scaleDown:
          stabilizationWindowSeconds: 300
          selectPolicy: Min
          policies:
            - type: Percent
              value: 10
              periodSeconds: 60
            - type: Pods
              value: 2
              periodSeconds: 60
  vminsert:
    replicaCount: 2
    extraArgs:
      loggerFormat: json
    resources:
      requests:
        cpu: 50m
        memory: 128Mi
      limits:
        cpu: 500m
        memory: 1024Mi
    hpa:
      minReplicas: 2
      maxReplicas: 10
      metrics:
        - type: Resource
          resource:
            name: cpu
            target:
              type: Utilization
              averageUtilization: 60
      behavior:
        scaleUp:
          stabilizationWindowSeconds: 0
          selectPolicy: Max
          policies:
            - type: Percent
              value: 100
              periodSeconds: 30
            - type: Pods
              value: 4
              periodSeconds: 30
        scaleDown:
          stabilizationWindowSeconds: 300
          selectPolicy: Min
          policies:
            - type: Percent
              value: 10
              periodSeconds: 60
            - type: Pods
              value: 2
              periodSeconds: 60
