apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: user
  namespace: openfaas-fn
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: user
  minReplicas: 1
  maxReplicas: 20
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 50
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 15
      policies:
        - type: Pods
          value: 1
          periodSeconds: 15
    scaleUp:
      stabilizationWindowSeconds: 15
      policies:
        - type: Pods
          value: 1
          periodSeconds: 15

