apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: ${APP_NAME} namespace: ${APP_NAME} spec: behavior: scaleDown: stabilizationWindowSeconds: 180 policies: - type: Percent value: 100 periodSeconds: 15 scaleUp: stabilizationWindowSeconds: 0 policies: - type: Percent value: 100 periodSeconds: 15 - type: Pods value: 4 periodSeconds: 15 selectPolicy: Max scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: ${APP_NAME} minReplicas: 1 maxReplicas: 20 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 50 # - type: Object # object: # metric: # name: requests-per-second # describedObject: # apiVersion: networking.k8s.io/v1beta1 # kind: ingress # name: ${APP_NAME} # target: # type: Value # value: 1 # - type: Pods # pods: # metric: # name: packets-per-second # target: # type: AverageValue # averageValue: 1k