Skip to content

Commit

Permalink
Bump QPS on namespace controller
Browse files Browse the repository at this point in the history
kubernetes#62913 switched from using a client pool, where each groupVersionResource got its own rest client, to a single client.

This increases the QPS to account for increased requests using a single rest client rate limiter.
  • Loading branch information
liggitt committed Apr 27, 2018
1 parent 7711d88 commit 1bddcdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/kube-controller-manager/app/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ func startNamespaceController(ctx ControllerContext) (bool, error) {
// the ratelimiter negatively affects its speed. Deleting 100 total items in a namespace (that's only a few of each resource
// including events), takes ~10 seconds by default.
nsKubeconfig := ctx.ClientBuilder.ConfigOrDie("namespace-controller")
nsKubeconfig.QPS *= 10
nsKubeconfig.Burst *= 10
nsKubeconfig.QPS *= 20
nsKubeconfig.Burst *= 100
namespaceKubeClient := clientset.NewForConfigOrDie(nsKubeconfig)

discoverResourcesFn := namespaceKubeClient.Discovery().ServerPreferredNamespacedResources
Expand Down
6 changes: 5 additions & 1 deletion test/e2e_node/services/namespace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ func NewNamespaceController(host string) *NamespaceController {

// Start starts the namespace controller.
func (n *NamespaceController) Start() error {
// Use the default QPS
config := restclient.AddUserAgent(&restclient.Config{Host: n.host}, ncName)

// the namespace cleanup controller is very chatty. It makes lots of discovery calls and then it makes lots of delete calls.
config.QPS = 50
config.Burst = 200

client, err := clientset.NewForConfig(config)
if err != nil {
return err
Expand Down

0 comments on commit 1bddcdc

Please sign in to comment.