Skip to content

fix(operator): apply Configuration.ClientConnection QPS/Burst to the manager rest.Config#3446

Closed
SAY-5 wants to merge 1 commit intokubeflow:masterfrom
SAY-5:fix/apply-client-connection-to-manager-3431
Closed

fix(operator): apply Configuration.ClientConnection QPS/Burst to the manager rest.Config#3446
SAY-5 wants to merge 1 commit intokubeflow:masterfrom
SAY-5:fix/apply-client-connection-to-manager-3431

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented Apr 22, 2026

Summary

Fixes #3431.

cfg.ClientConnection is validated and defaulted by the Configuration API (QPS=50, Burst=100) but never wired into the manager's rest.Config, so the manager ran with the client-go defaults (QPS=5, Burst=10). Operators tuning clientConnection saw the values take effect in the status server (pkg/statusserver/setup.go's createClient already does the rest.CopyConfig + override dance) but silently ignored for the main reconciler.

Fix

Mirror the status-server pattern in cmd/trainer-controller-manager/main.go: copy from ctrl.GetConfigOrDie(), overlay cfg.ClientConnection.{QPS,Burst} when non-nil, and hand that config to ctrl.NewManager. No behaviour change when ClientConnection is unset; new defaults now flow through when it is.

Test plan

  • go build ./cmd/trainer-controller-manager/... clean
  • go vet ./cmd/trainer-controller-manager/... clean
  • Manual: set clientConnection.qps = 25, clientConnection.burst = 50 in the Configuration CR, check the manager's actual rest client rate limits with --v=6 logging or the workqueue_*_requests_total metrics — should scale with the new values instead of topping out at QPS=5/Burst=10.

…Burst to the manager rest.Config

cfg.ClientConnection is validated and defaulted by the Configuration
API (QPS=50, Burst=100) but never wired into the manager's
rest.Config, so the manager ran with the client-go defaults (QPS=5,
Burst=10). Operators tuning clientConnection saw the values take
effect in the status server (createClient already does the
rest.CopyConfig + override dance) but silently ignored for the main
reconciler (#3431).

Mirror the status-server pattern: copy from ctrl.GetConfigOrDie(),
overlay cfg.ClientConnection.{QPS,Burst} if non-nil, hand that
config to ctrl.NewManager. No behaviour change when ClientConnection
is unset; new defaults now flow through when it is.

Fixes #3431

Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 22, 2026 08:22
@google-oss-prow
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign astefanutti for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@github-actions
Copy link
Copy Markdown

🎉 Welcome to the Kubeflow Trainer! 🎉

Thanks for opening your first PR! We're happy to have you as part of our community 🚀

Here's what happens next:

  • If you haven't already, please check out our Contributing Guide for repo-specific guidelines and the Kubeflow Contributor Guide for general community standards.
  • Our team will review your PR soon! cc @kubeflow/kubeflow-trainer-team

Join the community:

Feel free to ask questions in the comments if you need any help or clarification!
Thanks again for contributing to Kubeflow! 🙏

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Wires Configuration.ClientConnection QPS/Burst into the controller-manager’s rest.Config so the manager’s main Kubernetes client uses the validated/defaulted rate limits from the Configuration API (fixing the previously ignored settings described in #3431).

Changes:

  • Create a rest.Config variable for the manager and apply cfg.ClientConnection.{QPS,Burst} before constructing the controller-runtime manager.

Comment on lines +122 to +135
restCfg := ctrl.GetConfigOrDie()
// Apply the Configuration.ClientConnection QPS/Burst to the
// manager's rest.Config. Without this, the documented defaults
// (QPS=50, Burst=100) from the Configuration API were validated
// and defaulted but never wired through, so the manager ran with
// the client-go defaults (QPS=5, Burst=10). The status server's
// createClient already uses this pattern (#3431).
if cfg.ClientConnection != nil {
if cfg.ClientConnection.QPS != nil {
restCfg.QPS = *cfg.ClientConnection.QPS
}
if cfg.ClientConnection.Burst != nil {
restCfg.Burst = int(*cfg.ClientConnection.Burst)
}
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description mentions copying the config (like the status server does), but this code mutates the *rest.Config returned by ctrl.GetConfigOrDie() in place; either update the description or switch to rest.CopyConfig(...) before overriding QPS/Burst for consistency.

Copilot uses AI. Check for mistakes.
@SAY-5 SAY-5 changed the title trainer-controller-manager: apply Configuration.ClientConnection QPS/Burst to the manager rest.Config fix(trainer-controller-manager): apply Configuration.ClientConnection QPS/Burst to the manager rest.Config Apr 23, 2026
@SAY-5 SAY-5 changed the title fix(trainer-controller-manager): apply Configuration.ClientConnection QPS/Burst to the manager rest.Config fix(operator): apply Configuration.ClientConnection QPS/Burst to the manager rest.Config Apr 23, 2026
@robert-bell
Copy link
Copy Markdown
Contributor

Hey @SAY-5, thanks for jumping in on this!

It looks like @abhijeet-dhumal is already working on this issue and has opened #3432 for this issue. Would you be up for taking a look there and helping with review or testing? That’d be a great way to contribute here.

@SAY-5
Copy link
Copy Markdown
Author

SAY-5 commented Apr 23, 2026

Thanks @robert-bell — didn't realize #3432 was already in flight. Closing this in favor of @abhijeet-dhumal's PR. I'll take a look at #3432 to help with review/testing. Sorry for the noise!

@SAY-5 SAY-5 closed this Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clientConnection QPS/burst configuration is not applied to the manager client

3 participants