apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: makima-daemon
  labels:
    app: makima-daemon
    app.kubernetes.io/name: makima-daemon
    app.kubernetes.io/component: daemon
    app.kubernetes.io/part-of: makima
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: makima-daemon
  minReplicas: 1
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80
  behavior:
    scaleUp:
      stabilizationWindowSeconds: 60
      policies:
        - type: Pods
          value: 2
          periodSeconds: 60
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
        - type: Pods
          value: 1
          periodSeconds: 120
