Skip to content

Commit 0bcba80

Browse files
authored
Merge pull request kubernetes#2159 from arjunrn/update-scaling-behavior-kep
Updated Scaling Behavior KEP to reflect implementation
2 parents 1bb48a9 + c21a995 commit 0bcba80

File tree

1 file changed

+15
-17
lines changed
  • keps/sig-autoscaling/853-configurable-hpa-scale-velocity

1 file changed

+15
-17
lines changed

keps/sig-autoscaling/853-configurable-hpa-scale-velocity/README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,20 @@ To customize the scaling behavior we should add a `behavior` object with the fol
8484
- `scaleUp` specifies the rules which are used to control scaling behavior while scaling up.
8585
- `stabilizationWindowSeconds` - this value indicates the amount of time the HPA controller should consider
8686
previous recommendations to prevent flapping of the number of replicas.
87-
- `selectPolicy` can be `min` or `max` and specifies which value from the policies should be selected. The `max` value is used by default.
87+
- `selectPolicy` can be `Min`, `Max` or `Disabled` and specifies which value from the policies should be selected. The `Max` value is used by default.
8888
- `policies` a list of policies which regulate the amount of scaling. Each item has the following fields
89-
- `type` can have the value `pods` or `percent` which indicates the allowed changed in terms of absolute number of pods or percentage of current replicas.
89+
- `type` can have the value `Pods` or `Percent` which indicates the allowed changed in terms of absolute number of pods or percentage of current replicas.
9090
- `periodSeconds` the amount of time in seconds for which the rule should hold true.
9191
- `value` the value for the policy
9292
- `scaleDown` similar to the `scaleUp` but specifies the rules for scaling down.
9393

9494
A user will specify the parameters for the HPA, thus controlling the HPA logic.
9595

96-
The `selectPolicy` field indicates which policy should be applied. By default the `max` policy is chosen or in other words while scaling up the highest
96+
The `selectPolicy` field indicates which policy should be applied. By default the `Max` policy is chosen or in other words while scaling up the highest
9797
possible number of replicas is used and while scaling down the lowest possible number of replicas is chosen.
9898

9999
If the user does not specify `policies` for either `scaleUp` or `scaleDown` then default value for that policy is used
100-
(see the [Default Values] [] section below). Setting the `value` to `0` for `scaleUp` or `scaleDown` disables scaling in that direction.
100+
(see the [Default Values] [] section below).
101101

102102
[Default Values]: #default-values
103103
[Stabilization Window]: #stabilization-window
@@ -114,7 +114,7 @@ Create an HPA with the following configuration:
114114
behavior:
115115
scaleUp:
116116
policies:
117-
- type: percent
117+
- type: Percent
118118
value: 900%
119119
```
120120
@@ -142,11 +142,11 @@ Create an HPA with the following behavior:
142142
behavior:
143143
scaleUp:
144144
policies:
145-
- type: percent
145+
- type: Percent
146146
value: 900%
147147
scaleDown:
148148
policies:
149-
- type: pods
149+
- type: Pods
150150
value: 1
151151
periodSeconds: 600 # (i.e., scale down one pod every 10 min)
152152
```
@@ -165,7 +165,7 @@ Create an HPA with the following behavior:
165165
behavior:
166166
scaleUp:
167167
policies:
168-
- type: pods
168+
- type: Pods
169169
value: 1
170170
```
171171

@@ -186,9 +186,7 @@ Create an HPA with the following constraints:
186186
```yaml
187187
behavior:
188188
scaleDown:
189-
policies:
190-
- type: pods
191-
value: 0
189+
selectPolicy: Disabled
192190
```
193191

194192
The cluster will scale up as usual (default values), but will never scale down.
@@ -204,7 +202,7 @@ behavior:
204202
scaleDown:
205203
stabilizationWindowSeconds: 600
206204
policies:
207-
- type: pods
205+
- type: Pods
208206
value: 5
209207
```
210208

@@ -246,7 +244,7 @@ behavior:
246244
scaleUp:
247245
stabilizationWindowSeconds: 300
248246
policies:
249-
- type: pods
247+
- type: Pods
250248
value: 20
251249
```
252250

@@ -359,16 +357,16 @@ For smooth transition it makes sense to set the following default values:
359357
- `behavior.scaleUp.stabilizationWindowSeconds = 0`, do not gather recommendations, instantly scale up to the calculated number of replicas
360358
- `behavior.scaleUp.policies` has the following policies
361359
- Percentage policy
362-
- `policy = percent`
360+
- `policy = Percent`
363361
- `periodSeconds = 60`, one minute period for scaleUp
364362
- `value = 100` which means the number of replicas can be doubled every minute.
365363
- Pod policy
366-
- `policy = pods`
364+
- `policy = Pods`
367365
- `periodSeconds = 60`, one minute period for scaleUp
368366
- `value = 4` which means the 4 replicas can be added every minute.
369367
- `behavior.scaleDown.policies` has the following policies
370368
- Percentage Policy
371-
- `policy = percent`
369+
- `policy = Percent`
372370
- `periodSeconds = 60` one minute period for scaleDown
373371
- `value = 100` which means all the replicas can be scaled down in one minute.
374372

@@ -380,7 +378,7 @@ Please note that:
380378
- from the command-line options for the controller. Check the [Command Line Option Changes][] section.
381379
- from the hardcoded default value `300`.
382380

383-
The `scaleDown` behavior has a single `percent` policy with a value of `100` because
381+
The `scaleDown` behavior has a single `Percent` policy with a value of `100` because
384382
the current scale down behavior is only limited by [Stabilization Window][] which means after
385383
the stabilization window has passed the target can be scaled down to the minimum specified replicas.
386384
In order to replicate the default behavior we set `behavior.scaleDown.stabilizationWindowSeconds` to 300

0 commit comments

Comments
 (0)