Skip to content

Commit 7770299

Browse files
committed
fix: raise default --kube-api-qps/--kube-api-burst to 50/100
The previous defaults (QPS=20, Burst=30) cause client-side throttling with as few as 100 ScaledObjects, adding ~5s delay per status PATCH and making scale-to-zero take 15-20 minutes instead of ~5.5 minutes. Raise all three components (operator, metrics adapter, webhooks) to QPS=50 / Burst=100 to match what other large-scale controllers use (e.g. ArgoCD 50/100) while remaining well below API server capacity. Relates to #7613 Signed-off-by: Mikhail Fedosin <mfedosin@redhat.com>
1 parent accbfb6 commit 7770299

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/adapter/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ func main() {
238238
cmd.Flags().StringVar(&metricsServiceAddr, "metrics-service-address", generateDefaultMetricsServiceAddr(), "The address of the GRPC Metrics Service Server.")
239239
cmd.Flags().StringVar(&metricsServiceGRPCAuthority, "metrics-service-grpc-authority", "", "Host Authority override for the Metrics Service if the Host Authority is not the same as the address used for the GRPC Metrics Service Server.")
240240
cmd.Flags().StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.")
241-
cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
242-
cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
241+
cmd.Flags().Float32Var(&adapterClientRequestQPS, "kube-api-qps", 50.0, "Set the QPS rate for throttling requests sent to the apiserver")
242+
cmd.Flags().IntVar(&adapterClientRequestBurst, "kube-api-burst", 100, "Set the burst for throttling requests sent to the apiserver")
243243
cmd.Flags().BoolVar(&disableCompression, "disable-compression", true, "Disable response compression for k8s restAPI in client-go. ")
244244

245245
// legacy klogr flags handled for backwards compatibility. Default set to -1 so it doesn't override values set via zap options

cmd/operator/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ func main() {
100100
"Enable leader election for controller manager. "+
101101
"Enabling this will ensure there is only one active controller manager.")
102102
pflag.StringVar(&leaderElectionID, "leader-election-id", "operator.keda.sh", "Leader election ID for the controller manager. Defaults to operator.keda.sh")
103-
pflag.Float32Var(&adapterClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
104-
pflag.IntVar(&adapterClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
103+
pflag.Float32Var(&adapterClientRequestQPS, "kube-api-qps", 50.0, "Set the QPS rate for throttling requests sent to the apiserver")
104+
pflag.IntVar(&adapterClientRequestBurst, "kube-api-burst", 100, "Set the burst for throttling requests sent to the apiserver")
105105
pflag.BoolVar(&disableCompression, "disable-compression", true, "Disable response compression for k8s restAPI in client-go. ")
106106
pflag.StringVar(&certSecretName, "cert-secret-name", "kedaorg-certs", "KEDA certificates secret name. Defaults to kedaorg-certs")
107107
pflag.StringVar(&certDir, "cert-dir", "/certs", "Webhook certificates dir to use. Defaults to /certs")

cmd/webhooks/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func main() {
6565
pflag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
6666
pflag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
6767
pflag.StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.")
68-
pflag.Float32Var(&webhooksClientRequestQPS, "kube-api-qps", 20.0, "Set the QPS rate for throttling requests sent to the apiserver")
69-
pflag.IntVar(&webhooksClientRequestBurst, "kube-api-burst", 30, "Set the burst for throttling requests sent to the apiserver")
68+
pflag.Float32Var(&webhooksClientRequestQPS, "kube-api-qps", 50.0, "Set the QPS rate for throttling requests sent to the apiserver")
69+
pflag.IntVar(&webhooksClientRequestBurst, "kube-api-burst", 100, "Set the burst for throttling requests sent to the apiserver")
7070
pflag.StringVar(&certDir, "cert-dir", "/certs", "Webhook certificates dir to use. Defaults to /certs")
7171
pflag.IntVar(&webhooksPort, "port", 9443, "Port number to serve webhooks. Defaults to 9443")
7272
pflag.BoolVar(&cacheMissToDirectClient, "cache-miss-to-direct-client", false, "If true, on cache misses the webhook will call the direct client to fetch the object")

0 commit comments

Comments
 (0)