Clarify HPA Scaling Policies

Update content/en/docs/tasks/run-application/horizontal-pod-autoscale.md

Co-authored-by: Tim Bannister <tim@scalefactory.com>
pull/24262/head
GuyTempleton 2020-09-30 14:42:58 +01:00
parent 9e01fb5560
commit 5b15a7108f
No known key found for this signature in database
GPG Key ID: 1293A624D42B68E0
1 changed files with 6 additions and 6 deletions

View File

@ -319,7 +319,7 @@ For instance if there are 80 replicas and the target has to be scaled down to 10
then during the first step 8 replicas will be reduced. In the next iteration when the number
of replicas is 72, 10% of the pods is 7.2 but the number is rounded up to 8. On each loop of
the autoscaler controller the number of pods to be change is re-calculated based on the number
of current replicas. When the number of replicas falls below 40 the first policy_(Pods)_ is applied
of current replicas. When the number of replicas falls below 40 the first policy _(Pods)_ is applied
and 4 replicas will be reduced at a time.
`periodSeconds` indicates the length of time in the past for which the policy must hold true.
@ -328,7 +328,7 @@ allows at most 10% of the current replicas to be scaled down in one minute.
The policy selection can be changed by specifying the `selectPolicy` field for a scaling
direction. By setting the value to `Min` which would select the policy which allows the
smallest change in the replica count. Setting the value to `Disabled` completely disabled
smallest change in the replica count. Setting the value to `Disabled` completely disables
scaling in that direction.
### Stabilization Window
@ -405,8 +405,9 @@ behavior:
periodSeconds: 60
```
To allow a final drop of 5 pods, another policy can be added with a selection
strategy of maximum:
To ensure that no more than 5 Pods are removed per minute, you can add a second scale-down
policy with a fixed size of 5, and set `selectPolicy` to minimum. Setting `selectPolicy` to `Min` means
that the autoscaler chooses the policy that affects the smallest number of Pods:
```yaml
behavior:
@ -418,7 +419,7 @@ behavior:
- type: Pods
value: 5
periodSeconds: 60
selectPolicy: Max
selectPolicy: Min
```
### Example: disable scale down
@ -441,4 +442,3 @@ behavior:
* kubectl autoscale command: [kubectl autoscale](/docs/reference/generated/kubectl/kubectl-commands/#autoscale).
* Usage example of [Horizontal Pod Autoscaler](/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/).