Skip to content

✨ Add flags for configuring rate limits #1815

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ var (
openStackClusterConcurrency int
openStackMachineConcurrency int
syncPeriod time.Duration
restConfigQPS float32
restConfigBurst int
webhookPort int
webhookCertDir string
healthAddr string
Expand Down Expand Up @@ -128,6 +130,12 @@ func InitFlags(fs *pflag.FlagSet) {
fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute,
"The minimum interval at which watched resources are reconciled (e.g. 15m)")

fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")

fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Defaults to 30")

fs.IntVar(&webhookPort, "webhook-port", 9443,
"Webhook Server port")

Expand Down Expand Up @@ -181,6 +189,8 @@ func main() {
if err != nil {
setupLog.Error(err, "unable to get kubeconfig")
}
cfg.QPS = restConfigQPS
cfg.Burst = restConfigBurst

var caCerts []byte
if caCertsPath != "" {
Expand Down