From 77874c59ce051bc631190dc438ffe1bc5af1d22a Mon Sep 17 00:00:00 2001 From: Jaired Jawed Date: Wed, 12 Feb 2025 02:05:45 -0800 Subject: [PATCH] added kube-client-qps and kube-client-burst as cli arguments --- main.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/main.go b/main.go index c61206df..b9fab6c7 100644 --- a/main.go +++ b/main.go @@ -145,6 +145,8 @@ func main() { var backoffRandomizationFactor float64 var backoffMultiplier float64 var backoffMaxElapsedTime time.Duration + var kubeClientQPS float64 + var kubeClientBurst int // command-line args and flags flag.BoolVar(&printVersion, "version", false, "Print the operator version information") @@ -214,6 +216,14 @@ func main() { "All errors are tried using an exponential backoff strategy. "+ "The value must be greater than zero. "+ "Also set from environment variable VSO_BACKOFF_MULTIPLIER.") + flag.Float64Var(&kubeClientQPS, "kube-client-qps", 0, + "QPS indicates the maximum QPS to the kubernetes API. "+ + "When the value is 0, the kubernetes client's default is used."+ + "Also set from environment variable VSO_KUBE_CLIENT_QPS.") + flag.IntVar(&kubeClientBurst, "kube-client-burst", 0, + "Maximum burst for throttling requests to the kubernetes API."+ + "When the value is 0, the kubernetes client's default is used."+ + "Also set from environment variable VSO_KUBE_CLIENT_BURST.") opts := zap.Options{ Development: os.Getenv("VSO_LOGGER_DEVELOPMENT_MODE") != "", @@ -267,6 +277,12 @@ func main() { } else if globalVaultAuthOpts != "" { globalVaultAuthOptsSet = strings.Split(globalVaultAuthOpts, ",") } + if vsoEnvOptions.KubeClientQPS != 0 { + kubeClientQPS = vsoEnvOptions.KubeClientQPS + } + if vsoEnvOptions.KubeClientBurst != nil { + kubeClientBurst = *vsoEnvOptions.KubeClientBurst + } // versionInfo is used when setting up the buildInfo metric below versionInfo := version.Version()