@@ -35,11 +35,14 @@ import (
3535)
3636
3737var (
38- metricsAddr string
39- configPath string
40- leaderElection bool
41- leaderConfigMap string
42- leaderNamespace string
38+ metricsAddr string
39+ configPath string
40+ leaderElection bool
41+ leaderConfigMap string
42+ leaderNamespace string
43+ clientRequestQPS float64
44+ clientRequestBurst int
45+ disableCompression bool
4346)
4447
4548func main () {
@@ -49,6 +52,9 @@ func main() {
4952 flag .BoolVar (& leaderElection , "leader-election" , false , "enable leader election" )
5053 flag .StringVar (& leaderConfigMap , "leader-configmap" , "" , "Name of configmap to use for leader election" )
5154 flag .StringVar (& leaderNamespace , "leader-namespace" , "" , "Namespace where leader configmap located" )
55+ flag .Float64Var (& clientRequestQPS , "kube-api-qps" , 20.0 , "QPS rate for throttling requests sent to the Kubernetes API server" )
56+ flag .IntVar (& clientRequestBurst , "kube-api-burst" , 30 , "Maximum burst for throttling requests sent to the Kubernetes API server" )
57+ flag .BoolVar (& disableCompression , "disable-compression" , true , "Disable response compression for k8s restAPI in client-go" )
5258 flag .Parse ()
5359 logf .SetLogger (zap .New ())
5460 log := logf .Log .WithName ("entrypoint" )
@@ -68,6 +74,9 @@ func main() {
6874 // Get a config to talk to the apiserver
6975 log .Info ("setting up client for manager" )
7076 cfg , err := config .GetConfig ()
77+ cfg .QPS = float32 (clientRequestQPS )
78+ cfg .Burst = clientRequestBurst
79+ cfg .DisableCompression = disableCompression
7180 if err != nil {
7281 log .Error (err , "unable to set up client config" )
7382 os .Exit (1 )
0 commit comments