apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: mongoclaw
  namespace: mongoclaw
  labels:
    app.kubernetes.io/name: mongoclaw
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: mongoclaw
  minReplicas: 2
  maxReplicas: 10
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 70
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
        - type: Percent
          value: 10
          periodSeconds: 60
    scaleUp:
      stabilizationWindowSeconds: 0
      policies:
        - type: Percent
          value: 100
          periodSeconds: 15
        - type: Pods
          value: 4
          periodSeconds: 15
      selectPolicy: Max
