From 6212f0de6952be07e5a5cdd80d7a895b105c4937 Mon Sep 17 00:00:00 2001 From: Wen Zhou Date: Mon, 3 Jun 2024 10:39:15 +0200 Subject: [PATCH] feat: increase QPS and Burst for client (#1031) - we might see throttling in some cluster, this is just to uplift the default value Signed-off-by: Wen Zhou (cherry picked from commit 54ee87d2fc9e156644778f5e95f54011952aa49d) --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 43e2db5d272..33652797265 100644 --- a/main.go +++ b/main.go @@ -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" @@ -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") @@ -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 {