Skip to content

Commit

Permalink
feat: increase QPS and Burst for client (opendatahub-io#1031)
Browse files Browse the repository at this point in the history
- we might see throttling in some cluster, this is just to uplift the
default value

Signed-off-by: Wen Zhou <wenzhou@redhat.com>
(cherry picked from commit 54ee87d)
  • Loading branch information
zdtsw authored and VaishnaviHire committed Jun 18, 2024
1 parent 797f83e commit a315f77
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
Expand All @@ -60,6 +61,8 @@ import (
"github.com/opendatahub-io/opendatahub-operator/v2/pkg/upgrade"
)

const controllerNum = 4 // we should keep this updated if we have new controllers to add

var (
scheme = runtime.NewScheme()
setupLog = ctrl.Log.WithName("setup")
Expand Down Expand Up @@ -191,6 +194,9 @@ func main() {
setupLog.Error(err, "error getting config for setup")
os.Exit(1)
}
// uplift default limiataions
setupCfg.QPS = rest.DefaultQPS * controllerNum // 5 * 4 controllers
setupCfg.Burst = rest.DefaultBurst * controllerNum // 10 * 4 controllers

setupClient, err := client.New(setupCfg, client.Options{Scheme: scheme})
if err != nil {
Expand Down

0 comments on commit a315f77

Please sign in to comment.