You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-autoscaling/2021-scale-from-zero/README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -627,6 +627,14 @@ This section must be completed when targeting beta to a release.
627
627
As this is a new field every usage is opt-in. In case the kubernetes version is downgraded, currently scaled to 0 workloads might need to be manually scaled to 1 as the controller would treat them as
628
628
paused otherwise.
629
629
630
+
If a rollback is planned, the following steps should be performed before downgrading the kubernetes version:
631
+
632
+
1. Make sure there are no hpa objects with minReplicas=0 and maxReplicas=0. Here is a oneliner to update it to 1:
###### How can a rollout or rollback fail? Can it impact already running workloads?
631
639
632
640
<!--
@@ -641,6 +649,15 @@ will rollout across nodes.
641
649
642
650
There are no expected side-effects when the rollout fails as the new `ScaleToZero` condition should only be enabled once the version upgraded completed.
643
651
652
+
If the `kube-apiserver` has been upgraded before the `kube-controller-manager`, an HPA object has been updated to `minReplicas: 0` and the workload is already scaled down to 0 replicas, you must manually scale the workload to at least one replica.
653
+
654
+
You can detect this situation in one of two ways:
655
+
656
+
- Manually, by checking the HPA status and verifying that all entries show ScalingActive set to true and do not mention ScalingDisabled, or
657
+
658
+
- Automatically, by using the `kube_horizontalpodautoscaler_status_condition` metric provided by [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics)
659
+
to ensure the `ScalingActive` condition is `true.`
660
+
644
661
If an rollback is attempted, all HPAs should be updated to `minReplicas: 1` as otherwise HPA for deployments with zero replicas will be disabled until
645
662
replicas have been raised explicitly to at least `1`.
646
663
@@ -651,7 +668,9 @@ What signals should users be paying attention to when the feature is young
651
668
that might indicate a serious problem?
652
669
-->
653
670
654
-
If workloads aren't scaled up from 0 despite the scaling condition being meet, an operator should rollback this feature and manually scale an affected workload back to `1`.
671
+
If workloads an unexpected number of HPA entities contain a the status `ScalingActive``false` and mention `ScalingDisable` the feature isn't working as desired and all HPA objects should be updated to > 0 again and their managed workloads should be scaled to at least 1.
672
+
673
+
This condition can also be detected using the `kube_horizontalpodautoscaler_status_condition` metric provided by [kube-state-metrics](https://github.com/kubernetes/kube-state-metrics), but reason should be manually confirmed for flagged HPA objects.
655
674
656
675
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
0 commit comments