Skip to content

Commit

Permalink
deprecate unused node-autoprovisioning-enabled and max-autoprovisione…
Browse files Browse the repository at this point in the history
…d-node-group-count flags

Signed-off-by: Prashant Rewar <[email protected]>
  • Loading branch information
prashantrewar committed Nov 3, 2023
1 parent 4d8e654 commit 8b83bf3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cluster-autoscaler/core/test/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ func (p *MockAutoprovisioningNodeGroupManager) CreateNodeGroup(context *context.

// RemoveUnneededNodeGroups removes uneeded node groups
func (p *MockAutoprovisioningNodeGroupManager) RemoveUnneededNodeGroups(context *context.AutoscalingContext) (removedNodeGroups []cloudprovider.NodeGroup, err error) {
if !context.AutoscalingOptions.NodeAutoprovisioningEnabled {
return nil, nil
}

removedNodeGroups = make([]cloudprovider.NodeGroup, 0)
nodeGroups := context.CloudProvider.NodeGroups()
for _, nodeGroup := range nodeGroups {
Expand Down
12 changes: 10 additions & 2 deletions cluster-autoscaler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ var (
maxInactivityTimeFlag = flag.Duration("max-inactivity", 10*time.Minute, "Maximum time from last recorded autoscaler activity before automatic restart")
maxFailingTimeFlag = flag.Duration("max-failing-time", 15*time.Minute, "Maximum time from last recorded successful autoscaler run before automatic restart")
balanceSimilarNodeGroupsFlag = flag.Bool("balance-similar-node-groups", false, "Detect similar node groups and balance the number of nodes between them")
nodeAutoprovisioningEnabled = flag.Bool("node-autoprovisioning-enabled", false, "Should CA autoprovision node groups when needed")
maxAutoprovisionedNodeGroupCount = flag.Int("max-autoprovisioned-node-group-count", 15, "The maximum number of autoprovisioned groups in the cluster.")
nodeAutoprovisioningEnabled = flag.Bool("node-autoprovisioning-enabled", false, "Should CA autoprovision node groups when needed.This flag is deprecated and will be removed in future releases.")
maxAutoprovisionedNodeGroupCount = flag.Int("max-autoprovisioned-node-group-count", 15, "The maximum number of autoprovisioned groups in the cluster.This flag is deprecated and will be removed in future releases.")

unremovableNodeRecheckTimeout = flag.Duration("unremovable-node-recheck-timeout", 5*time.Minute, "The timeout before we check again a node that couldn't be removed before")
expendablePodsPriorityCutoff = flag.Int("expendable-pods-priority-cutoff", -10, "Pods with priority below cutoff will be expendable. They can be killed without any consideration during scale down and they don't cause scale up. Pods with null priority (PodPriority disabled) are non expendable.")
Expand Down Expand Up @@ -286,6 +286,14 @@ func createAutoscalingOptions() config.AutoscalingOptions {
*maxEmptyBulkDeleteFlag = *maxScaleDownParallelismFlag
}

if isFlagPassed("node-autoprovisioning-enabled") {
klog.Warning("The node-autoprovisioning-enabled flag is deprecated and will be removed in k8s version 1.31.")
}

if isFlagPassed("max-autoprovisioned-node-group-count") {
klog.Warning("The max-autoprovisioned-node-group-count flag is deprecated and will be removed in k8s version 1.31.")
}

var parsedSchedConfig *scheduler_config.KubeSchedulerConfiguration
// if scheduler config flag was set by the user
if pflag.CommandLine.Changed(config.SchedulerConfigFileFlag) {
Expand Down

0 comments on commit 8b83bf3

Please sign in to comment.