Kubernetes HorizontalPodAutoscaler Scale in multiples of 3

162 views Asked by At

We want our deployment to have 3/6/9/etc replicas at all times to have an even AZ spread. Is there a way to achieve this via HPA config ?

1

There are 1 answers

0
Harsh Manvar On BEST ANSWER

You can use the Scaling policy with the HPA

Example

scaleUp:
    stabilizationWindowSeconds: 0
    policies:
    - type: Pods
      value: 3
      periodSeconds: 5
    selectPolicy: Max

it will add the 3 PODs every 5 second until HPA metrics become steady.

Ref doc : https://github.com/kubernetes/enhancements/blob/master/keps/sig-autoscaling/853-configurable-hpa-scale-velocity/README.md