Initialize default drainability rules
This commit is contained in:
parent
a3a29cf5dd
commit
ab4c5cb8c7
|
|
@ -144,6 +144,9 @@ func initializeDefaultOptions(opts *AutoscalerOptions) error {
|
|||
opts.Backoff =
|
||||
backoff.NewIdBasedExponentialBackoff(opts.InitialNodeGroupBackoffDuration, opts.MaxNodeGroupBackoffDuration, opts.NodeGroupBackoffResetTimeout)
|
||||
}
|
||||
if opts.DrainabilityRules == nil {
|
||||
opts.DrainabilityRules = rules.Default(opts.DeleteOptions)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -462,6 +462,7 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
|
|||
return nil, err
|
||||
}
|
||||
deleteOptions := options.NewNodeDeleteOptions(autoscalingOptions)
|
||||
drainabilityRules := rules.Default(deleteOptions)
|
||||
|
||||
opts := core.AutoscalerOptions{
|
||||
AutoscalingOptions: autoscalingOptions,
|
||||
|
|
@ -472,6 +473,7 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
|
|||
DebuggingSnapshotter: debuggingSnapshotter,
|
||||
PredicateChecker: predicateChecker,
|
||||
DeleteOptions: deleteOptions,
|
||||
DrainabilityRules: drainabilityRules,
|
||||
}
|
||||
|
||||
opts.Processors = ca_processors.DefaultProcessors(autoscalingOptions)
|
||||
|
|
@ -481,7 +483,7 @@ func buildAutoscaler(debuggingSnapshotter debuggingsnapshot.DebuggingSnapshotter
|
|||
if autoscalingOptions.ParallelDrain {
|
||||
sdCandidatesSorting := previouscandidates.NewPreviousCandidates()
|
||||
scaleDownCandidatesComparers = []scaledowncandidates.CandidatesComparer{
|
||||
emptycandidates.NewEmptySortingProcessor(emptycandidates.NewNodeInfoGetter(opts.ClusterSnapshot), deleteOptions, rules.Default(deleteOptions)),
|
||||
emptycandidates.NewEmptySortingProcessor(emptycandidates.NewNodeInfoGetter(opts.ClusterSnapshot), deleteOptions, drainabilityRules),
|
||||
sdCandidatesSorting,
|
||||
}
|
||||
opts.Processors.ScaleDownCandidatesNotifier.Register(sdCandidatesSorting)
|
||||
|
|
|
|||
Loading…
Reference in New Issue