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

Fix number of reconcilers for Pod integration #1835

Merged
merged 1 commit into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/components/manager/controller_manager_config.yaml
Expand Up @@ -13,7 +13,7 @@ leaderElection:
controller:
groupKindConcurrency:
Job.batch: 5
Pod.: 5
Pod: 5
Workload.kueue.x-k8s.io: 5
LocalQueue.kueue.x-k8s.io: 1
ClusterQueue.kueue.x-k8s.io: 1
Expand Down
6 changes: 6 additions & 0 deletions pkg/controller/jobs/pod/pod_controller.go
Expand Up @@ -43,6 +43,7 @@ import (
"k8s.io/utils/ptr"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"

kueue "sigs.k8s.io/kueue/apis/kueue/v1beta1"
Expand Down Expand Up @@ -108,9 +109,14 @@ func (r *Reconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Resu
}

func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
concurrency := mgr.GetControllerOptions().GroupKindConcurrency[gvk.GroupKind().String()]
ctrl.Log.V(3).Info("Setting up Pod reconciler", "concurrency", concurrency)
return ctrl.NewControllerManagedBy(mgr).
Watches(&corev1.Pod{}, &podEventHandler{cleanedUpPodsExpectations: r.expectationsStore}).Named("v1_pod").
Watches(&kueue.Workload{}, &workloadHandler{}).
WithOptions(controller.Options{
MaxConcurrentReconciles: concurrency,
}).
Complete(r)
}

Expand Down