Skip to content

Commit

Permalink
add experimental rate limiter to gardener client
Browse files Browse the repository at this point in the history
  • Loading branch information
m00g3n committed Nov 20, 2024
1 parent 5b3b295 commit 78dd238
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import (
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
_ "k8s.io/client-go/plugin/pkg/client/auth"
"k8s.io/client-go/rest"
"k8s.io/client-go/util/flowcontrol"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
Expand Down Expand Up @@ -240,6 +241,8 @@ func initGardenerClients(kubeconfigPath string, namespace string) (client.Client
return nil, nil, nil, err
}

restConfig.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(5, 5)

gardenerClientSet, err := gardener_apis.NewForConfig(restConfig)
if err != nil {
return nil, nil, nil, err
Expand Down

0 comments on commit 78dd238

Please sign in to comment.