Skip to content

Commit 1a7b2cc

Browse files
authored
Merge pull request #4555 from ialidzhikov/automated-cherry-pick-of-#4539-upstream-cluster-autoscaler-release-1.20
[release-1.20] Automated cherry pick of #4539: Add `--feature-gates` flag to support scale up on volume
2 parents 89645b0 + db2060b commit 1a7b2cc

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
@@ -31,6 +31,7 @@ this document:
3131
* [How can I scale a node group to 0?](#how-can-i-scale-a-node-group-to-0)
3232
* [How can I prevent Cluster Autoscaler from scaling down a particular node?](#how-can-i-prevent-cluster-autoscaler-from-scaling-down-a-particular-node)
3333
* [How can I configure overprovisioning with Cluster Autoscaler?](#how-can-i-configure-overprovisioning-with-cluster-autoscaler)
34+
* [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)
3435
* [Internals](#internals)
3536
* [Are all of the mentioned heuristics and timings final?](#are-all-of-the-mentioned-heuristics-and-timings-final)
3637
* [How does scale-up work?](#how-does-scale-up-work)
@@ -433,6 +434,17 @@ spec:
433434
serviceAccountName: cluster-proportional-autoscaler-service-account
434435
```
435436

437+
### How can I enable Cluster Autoscaler to scale up when Node's max volume count is exceeded (CSI migration enabled)?
438+
439+
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).
440+
441+
For example:
442+
```
443+
--feature-gates=CSIMigration=true,CSIMigration{Provdider}=true,InTreePlugin{Provider}Unregister=true
444+
```
445+
446+
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/).
447+
436448
****************
437449

438450
# Internals
@@ -681,6 +693,7 @@ The following startup parameters are supported for cluster autoscaler:
681693
| `skip-nodes-with-system-pods` | If true cluster autoscaler will never delete nodes with pods from kube-system (except for DaemonSet or mirror pods) | true
682694
| `skip-nodes-with-local-storage`| If true cluster autoscaler will never delete nodes with pods with local storage, e.g. EmptyDir or HostPath | true
683695
| `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
696+
| `feature-gates` | A set of key=value pairs that describe feature gates for alpha/experimental features. | ""
684697

685698
# Troubleshooting:
686699

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"
@@ -375,7 +376,9 @@ func main() {
375376
leaderElection.LeaderElect = true
376377

377378
options.BindLeaderElectionFlags(&leaderElection, pflag.CommandLine)
379+
utilfeature.DefaultMutableFeatureGate.AddFlag(pflag.CommandLine)
378380
kube_flag.InitFlags()
381+
379382
healthCheck := metrics.NewHealthCheck(*maxInactivityTimeFlag, *maxFailingTimeFlag)
380383

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

0 commit comments

Comments
 (0)