Hi,
I noticed that the worker count is 1
2020-05-24T11:30:32.287+0800 INFO controller-runtime.controllercontroller/controller.go:154 Starting workers {"controller": "test", "worker count": 1}
2020-05-24T11:30:32.287+0800 INFO controller-runtime.controllercontroller/controller.go:154 Starting workers {"controller": "test2", "worker count": 1}
And I found there is no way to set MaxConcurrentReconciles. Could you help me to know how to set it. Thanks.
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
MetricsBindAddress: metricsAddr,
LeaderElection: enableLeaderElection,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
os.Exit(1)
}
const jobPollInterval = "5s"
err = trainingjob.
NewTrainingJobReconciler(
mgr.GetClient(),
ctrl.Log.WithName("controllers").WithName("TrainingJob"),
parseDurationOrPanic(jobPollInterval)).
SetupWithManager(mgr)
if err != nil {
setupLog.Error(err, "unable to create controller", "controller", "TrainingJob")
os.Exit(1)
}
@cheyang you can define MaxConcurrentReconciles using WithOptions(...) inside SetupWithManager call as
return ctrl.NewControllerManagedBy(mgr).
For(&batch.CronJob{}).
Owns(&kbatch.Job{}).
WithOptions(...).
Complete(r)
/milestone Next
/triage support
Closing given that the answer from @dmvolod is correct, feel free to reopen if necessary.
/close
@vincepri: Closing this issue.
In response to this:
/milestone Next
/triage supportClosing given that the answer from @dmvolod is correct, feel free to reopen if necessary.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
There is an example for setting MaxConcurrentReconciles here:
https://sdk.operatorframework.io/docs/building-operators/golang/tutorial/
Most helpful comment
@cheyang you can define MaxConcurrentReconciles using WithOptions(...) inside SetupWithManager call as