Skip to content

Commit e8db5d9

Browse files
authored
Merge pull request #1817 from k8s-infra-cherrypick-robot/cherry-pick-1815-to-release-0.9
[release-0.9] ✨ Add flags for configuring rate limits
2 parents 95a4004 + 880b999 commit e8db5d9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

main.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ var (
6868
openStackClusterConcurrency int
6969
openStackMachineConcurrency int
7070
syncPeriod time.Duration
71+
restConfigQPS float32
72+
restConfigBurst int
7173
webhookPort int
7274
webhookCertDir string
7375
healthAddr string
@@ -126,6 +128,12 @@ func InitFlags(fs *pflag.FlagSet) {
126128
fs.DurationVar(&syncPeriod, "sync-period", 10*time.Minute,
127129
"The minimum interval at which watched resources are reconciled (e.g. 15m)")
128130

131+
fs.Float32Var(&restConfigQPS, "kube-api-qps", 20,
132+
"Maximum queries per second from the controller client to the Kubernetes API server. Defaults to 20")
133+
134+
fs.IntVar(&restConfigBurst, "kube-api-burst", 30,
135+
"Maximum number of queries that should be allowed in one burst from the controller client to the Kubernetes API server. Defaults to 30")
136+
129137
fs.IntVar(&webhookPort, "webhook-port", 9443,
130138
"Webhook Server port")
131139

@@ -179,6 +187,8 @@ func main() {
179187
if err != nil {
180188
setupLog.Error(err, "unable to get kubeconfig")
181189
}
190+
cfg.QPS = restConfigQPS
191+
cfg.Burst = restConfigBurst
182192

183193
var caCerts []byte
184194
if caCertsPath != "" {

0 commit comments

Comments
 (0)