Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1908 #2007

Merged
merged 4 commits into from
Apr 10, 2024
Merged

1908 #2007

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cmd/yurt-manager/app/options/nodepoolcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewNodePoolControllerOptions() *NodePoolControllerOptions {
return &NodePoolControllerOptions{
&config.NodePoolControllerConfiguration{
EnableSyncNodePoolConfigurations: true,
ConcurrentNodepools: 3,
},
}
}
Expand All @@ -40,7 +41,7 @@ func (n *NodePoolControllerOptions) AddFlags(fs *pflag.FlagSet) {
return
}

fs.BoolVar(&n.EnableSyncNodePoolConfigurations, "enable-sync-nodepool-configurations", n.EnableSyncNodePoolConfigurations, "enable to sync nodepool configurations(including labels, annotations, taints in spec) to nodes in the nodepool.")
fs.Int32Var(&n.ConcurrentNodepools, "concurrent-nodepools", n.ConcurrentNodepools, "The number of node pools that are allowed to reconcile concurrently.")
}

// ApplyTo fills up nodePool config with options.
Expand All @@ -49,6 +50,7 @@ func (o *NodePoolControllerOptions) ApplyTo(cfg *config.NodePoolControllerConfig
return nil
}
cfg.EnableSyncNodePoolConfigurations = o.EnableSyncNodePoolConfigurations
cfg.ConcurrentNodepools = o.ConcurrentNodepools

return nil
}
Expand Down
1 change: 1 addition & 0 deletions pkg/yurtmanager/controller/nodepool/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ package config
// NodePoolControllerConfiguration contains elements describing NodePoolController.
type NodePoolControllerConfiguration struct {
EnableSyncNodePoolConfigurations bool
ConcurrentNodepools int32
}
5 changes: 2 additions & 3 deletions pkg/yurtmanager/controller/nodepool/nodepool_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@
)

var (
concurrentReconciles = 3
controllerResource = appsv1beta1.SchemeGroupVersion.WithResource("nodepools")
controllerResource = appsv1beta1.SchemeGroupVersion.WithResource("nodepools")
)

func Format(format string, args ...interface{}) string {
Expand Down Expand Up @@ -80,7 +79,7 @@

// Create a new controller
ctrl, err := controller.New(names.NodePoolController, mgr, controller.Options{
Reconciler: r, MaxConcurrentReconciles: concurrentReconciles,
Reconciler: r, MaxConcurrentReconciles: int(c.ComponentConfig.NodePoolController.ConcurrentNodepools),

Check warning on line 82 in pkg/yurtmanager/controller/nodepool/nodepool_controller.go

View check run for this annotation

Codecov / codecov/patch

pkg/yurtmanager/controller/nodepool/nodepool_controller.go#L82

Added line #L82 was not covered by tests
})
if err != nil {
return err
Expand Down
Loading