Skip to content

Commit fdc76d1

Browse files
authored
Merge pull request #4553 from ialidzhikov/automated-cherry-pick-of-#4539-upstream-cluster-autoscaler-release-1.22
[release-1.22] Automated cherry pick of #4539: Add `--feature-gates` flag to support scale up on volume
2 parents d423516 + 8faddc5 commit fdc76d1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cluster-autoscaler/FAQ.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ this document:
3333
* [How can I prevent Cluster Autoscaler from scaling down a particular node?](#how-can-i-prevent-cluster-autoscaler-from-scaling-down-a-particular-node)
3434
* [How can I configure overprovisioning with Cluster Autoscaler?](#how-can-i-configure-overprovisioning-with-cluster-autoscaler)
3535
* [How can I enable/disable eviction for a specific DaemonSet](#how-can-i-enabledisable-eviction-for-a-specific-daemonset)
36+
* [How can I enable Cluster Autoscaler to scale up when Node's max volume count is exceeded (CSI migration enabled)?](#how-can-i-enable-cluster-autoscaler-to-scale-up-when-nodes-max-volume-count-is-exceeded-csi-migration-enabled)
3637
* [Internals](#internals)
3738
* [Are all of the mentioned heuristics and timings final?](#are-all-of-the-mentioned-heuristics-and-timings-final)
3839
* [How does scale-up work?](#how-does-scale-up-work)
@@ -459,6 +460,17 @@ sufficient to modify the pod spec in the DaemonSet object.
459460
460461
This annotation has no effect on pods that are not a part of any DaemonSet.
461462
463+
### How can I enable Cluster Autoscaler to scale up when Node's max volume count is exceeded (CSI migration enabled)?
464+
465+
Kubernetes scheduler will fail to schedule a Pod to a Node if the Node's max volume count is exceeded. In such case to enable Cluster Autoscaler to scale up in a Kubernetes cluster with [CSI migration](https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/625-csi-migration/README.md) enabled, the appropriate CSI related feature gates have to be specified for the Cluster Autoscaler (if the corresponding feature gates are not enabled by default).
466+
467+
For example:
468+
```
469+
--feature-gates=CSIMigration=true,CSIMigration{Provdider}=true,InTreePlugin{Provider}Unregister=true
470+
```
471+
472+
For a complete list of the feature gates and their default values per Kubernetes versions, refer to the [Feature Gates documentation](https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/).
473+
462474
****************
463475
464476
# Internals
@@ -729,6 +741,7 @@ The following startup parameters are supported for cluster autoscaler:
729741
| `min-replica-count` | Minimum number or replicas that a replica set or replication controller should have to allow their pods deletion in scale down | 0
730742
| `daemonset-eviction-for-empty-nodes` | Whether DaemonSet pods will be gracefully terminated from empty nodes | false
731743
| `daemonset-eviction-for-occupied-nodes` | Whether DaemonSet pods will be gracefully terminated from non-empty nodes | true
744+
| `feature-gates` | A set of key=value pairs that describe feature gates for alpha/experimental features. | ""
732745
733746
# Troubleshooting:
734747

cluster-autoscaler/main.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3535
"k8s.io/apiserver/pkg/server/mux"
3636
"k8s.io/apiserver/pkg/server/routes"
37+
utilfeature "k8s.io/apiserver/pkg/util/feature"
3738
"k8s.io/autoscaler/cluster-autoscaler/cloudprovider"
3839
cloudBuilder "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/builder"
3940
"k8s.io/autoscaler/cluster-autoscaler/config"
@@ -391,7 +392,9 @@ func main() {
391392
leaderElection.LeaderElect = true
392393

393394
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)
395+
utilfeature.DefaultMutableFeatureGate.AddFlag(pflag.CommandLine)
394396
kube_flag.InitFlags()
397+
395398
healthCheck := metrics.NewHealthCheck(*maxInactivityTimeFlag, *maxFailingTimeFlag)
396399

397400
klog.V(1).Infof("Cluster Autoscaler %s", version.ClusterAutoscalerVersion)

0 commit comments

Comments
 (0)