Skip to content

Commit 107f4a7

Browse files
authored
Merge pull request #26452 from jacksgt/patch-1
Clarify selection of default HPA scaling policy
2 parents a4e48ec + a33e903 commit 107f4a7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,19 @@ behavior:
383383
periodSeconds: 60
384384
```
385385

386-
When the number of pods is more than 40 the second policy will be used for scaling down.
386+
`periodSeconds` indicates the length of time in the past for which the policy must hold true.
387+
The first policy _(Pods)_ allows at most 4 replicas to be scaled down in one minute. The second policy
388+
_(Percent)_ allows at most 10% of the current replicas to be scaled down in one minute.
389+
390+
Since by default the policy which allows the highest amount of change is selected, the second policy will
391+
only be used when the number of pod replicas is more than 40. With 40 or less replicas, the first policy will be applied.
387392
For instance if there are 80 replicas and the target has to be scaled down to 10 replicas
388393
then during the first step 8 replicas will be reduced. In the next iteration when the number
389394
of replicas is 72, 10% of the pods is 7.2 but the number is rounded up to 8. On each loop of
390395
the autoscaler controller the number of pods to be change is re-calculated based on the number
391396
of current replicas. When the number of replicas falls below 40 the first policy _(Pods)_ is applied
392397
and 4 replicas will be reduced at a time.
393398

394-
`periodSeconds` indicates the length of time in the past for which the policy must hold true.
395-
The first policy allows at most 4 replicas to be scaled down in one minute. The second policy
396-
allows at most 10% of the current replicas to be scaled down in one minute.
397-
398399
The policy selection can be changed by specifying the `selectPolicy` field for a scaling
399400
direction. By setting the value to `Min` which would select the policy which allows the
400401
smallest change in the replica count. Setting the value to `Disabled` completely disables
@@ -441,7 +442,7 @@ behavior:
441442
periodSeconds: 15
442443
selectPolicy: Max
443444
```
444-
For scaling down the stabilization window is _300_ seconds(or the value of the
445+
For scaling down the stabilization window is _300_ seconds (or the value of the
445446
`--horizontal-pod-autoscaler-downscale-stabilization` flag if provided). There is only a single policy
446447
for scaling down which allows a 100% of the currently running replicas to be removed which
447448
means the scaling target can be scaled down to the minimum allowed replicas.

0 commit comments

Comments
 (0)