Skip to content

Commit df5b1b9

Browse files
jm-francpr00se
andcommitted
Apply suggestions from code review.
Co-authored-by: Patryk Prus <[email protected]>
1 parent 23c4ff1 commit df5b1b9

File tree

1 file changed

+26
-10
lines changed
  • keps/sig-autoscaling/4951-configurable-hpa-tolerance

1 file changed

+26
-10
lines changed

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

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ type HPAScalingRules struct {
235235
```
236236

237237
This new tolerance will be taken into account in the autoscaling controller
238-
[replica_calculator.go][]. The update to the logic is:
238+
[replica_calculator.go][]. The current logic is:
239239

240240
```golang
241241
if math.Abs(1.0-usageRatio) <= c.tolerance { /* ... */ }
@@ -257,11 +257,11 @@ It will be replaced by:
257257
+ if (1.0-downTolerance) <= usageRatio && usageRatio <= (1.0+upTolerance) { /* ... */ }
258258
```
259259

260-
Since the added field is optional and has a default value compatible with the
261-
current autoscaling behavior, this feature can be added to the current API
260+
Since the added field is optional and it's omission results in no change to the existing
261+
autoscaling behavior, this feature can be added to the current API
262262
version `pkg/apis/autoscaling/v2`.
263263

264-
The feature presented in this KEP only allows to tune an existing parameter, and
264+
The feature presented in this KEP only allows users to tune an existing parameter, and
265265
as such doesn't require any new HPA Events or modify any Status. A new error is
266266
emitted if a `tolerance` field is set to a negative value.
267267

@@ -426,13 +426,15 @@ in back-to-back releases.
426426

427427
### Upgrade / Downgrade Strategy
428428

429-
Upgrades present no particular issue: the new field won't be set and the HPA
430-
will behave like it does today. Users can use the new feature by setting the
431-
new `tolerance` field (provided the Feature Gate is enabled).
429+
#### Upgrade
430+
Existing HPAs will continue to work as they do today, using the global `horizontal-pod-autoscaler-tolerance`
431+
value from the `kube-controller-manager`. Users can use the new feature by enabling the Feature
432+
Gate (alpha only) and setting the new `tolerance` field on an HPA.
432433

433-
On downgrades to a version that does not support this functionality, an HPA will
434-
ignore any configured `tolerance` field, and use the default (as specified by
435-
`--horizontal-pod-autoscaler-tolerance`).
434+
#### Downgrade
435+
On downgrade, all HPAs will revert to using the global `horizontal-pod-autoscaler-tolerance`
436+
value from the `kube-controller-manager`, regardless of any configured `tolerance` value on the HPA
437+
itself.
436438

437439
### Version Skew Strategy
438440

@@ -495,6 +497,8 @@ Any change of default behavior may be surprising to users or break existing
495497
automations, so be extremely careful here.
496498
-->
497499

500+
No.
501+
498502
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
499503

500504
<!--
@@ -508,8 +512,14 @@ feature.
508512
NOTE: Also set `disable-supported` to `true` or `false` in `kep.yaml`.
509513
-->
510514

515+
The feature can be disabled by restarting the `kube-controller-manager` with the feature gate set to `false`.
516+
517+
Any `tolerance` values set on existing HPAs will be ignored by the `kube-controller-manager` when the feature gate is off.
518+
511519
###### What happens if we reenable the feature if it was previously rolled back?
512520

521+
When the feature is re-enabled, any HPAs with configured `tolerance` values will use those when calculating replica counts, rather than the global tolerance from the `kube-controller-manager`.
522+
513523
###### Are there any tests for feature enablement/disablement?
514524

515525
<!--
@@ -687,6 +697,8 @@ Focusing mostly on:
687697
heartbeats, leader election, etc.)
688698
-->
689699

700+
No.
701+
690702
###### Will enabling / using this feature result in introducing new API types?
691703

692704
<!--
@@ -696,6 +708,8 @@ Describe them, providing:
696708
- Supported number of objects per namespace (for namespace-scoped objects)
697709
-->
698710

711+
No.
712+
699713
###### Will enabling / using this feature result in any new calls to the cloud provider?
700714

701715
<!--
@@ -704,6 +718,8 @@ Describe them, providing:
704718
- Estimated increase:
705719
-->
706720

721+
No.
722+
707723
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
708724

709725
<!--

0 commit comments

Comments
 (0)