Skip to content

Commit

Permalink
added kube-client-qps and kube-client-burst as cli arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jaireddjawed committed Feb 12, 2025
1 parent 7e3f6fd commit 77874c5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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") != "",
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 77874c5

Please sign in to comment.