Skip to content

Commit

Permalink
Make MaxConcurrentReconciles tunable
Browse files Browse the repository at this point in the history
This controller-runtime option controls how many nodes can be reconciled
concurrently. It defaults to 1, but can be safely increased to increase
throughput in busy clusters.
  • Loading branch information
cbroglie committed Jun 23, 2022
1 parent bf2b3e1 commit 5dcd1b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/sciuro/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ type config struct {
DevMode bool `env:"SCIURO_DEV_MODE" envDefault:"false"`
// ReconcileTimeout is the maximum time given to reconcile a node.
ReconcileTimeout time.Duration `env:"SCIURO_RECONCILE_TIMEOUT" envDefault:"45s"`
// MaxConcurrentReconciles is the maximum number of nodes which can be
// reconciled concurrently.
MaxConcurrentReconciles int `env:"SCIURO_MAX_CONCURRENT_RECONCILES" envDefault:"1"`
// AlertReceiver is the receiver to use for server-side filtering of alerts
// must be the same across all targeted nodes in the cluster
AlertReceiver string `env:"SCIURO_ALERT_RECEIVER,required"`
Expand Down Expand Up @@ -121,7 +124,8 @@ func main() {
)

c, err := controller.New("node-status-controller", mgr, controller.Options{
Reconciler: r,
MaxConcurrentReconciles: cfg.MaxConcurrentReconciles,
Reconciler: r,
})
if err != nil {
entryLog.Error(err, "unable to set up individual controller")
Expand Down

0 comments on commit 5dcd1b5

Please sign in to comment.