Skip to content

Commit 4058fff

Browse files
jm-francpr00se
andcommitted
Improve description of the 'tolerance' field.
Co-authored-by: Patryk Prus <[email protected]>
1 parent 9fc2d07 commit 4058fff

File tree

1 file changed

+11
-7
lines changed
  • keps/sig-autoscaling/4951-configurable-hpa-tolerance

1 file changed

+11
-7
lines changed

keps/sig-autoscaling/4951-configurable-hpa-tolerance/README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,19 @@ The exact API recommended here has been previously proposed in [kep-853][] (see
194194

195195
## Proposal
196196

197-
We propose to complement the existing `HorizontalPodAutoscaler` `behavior`
198-
`scaleUp` and `scaleDown` objects with a new field:
197+
We propose to add a new field to the existing [`HPAScalingRules`][] object:
199198

200-
- `scaleUp`:
201-
- `tolerance`: the tolerance on the ratio between the *current* and *desired* values of the metric this HorizontalPodAutoscaler operates on, for scaling up. operations. Must be greater or equal to 0.
202-
- `scaleDown`:
203-
- `tolerance`: similar to `scaleUp.tolerance`, for scaling down.
199+
- `tolerance`: (float) the minimum change (from 1.0) in the desired-to-actual metrics ratio for the horizontal pod autoscaler to consider scaling. Must be greater than or equal to 0.
204200

205-
Those fields are optional, and default to the value used today.
201+
The `tolerance` field is optional, and when not specified the HPA will continue to use the
202+
value of the global `--horizontal-pod-autoscaler-tolerance` as the tolerance for scaling
203+
calculations.
204+
205+
Since there are separate `HPAScalingRules` objects defined for an HPA's
206+
`spec.behavior.scaleUp` and `spec.behavior.scaleDown`, it is possible to specify different
207+
`tolerance` values for scaling up vs. scaling down.
208+
209+
[HPAScalingRules]: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.31/#hpascalingrules-v2-autoscaling
206210

207211
### Risks and Mitigations
208212

0 commit comments

Comments
 (0)