Add kube-api-qps and kube-api-burst flags to cdi-controller and cdi-apiserver #4325
All Vouch review confidence checks passed
Residual risk 0.43 = Change Risk (0.72) × (1 − Review Confidence (0.41)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.72 · 341 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.349
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.072
Real PR Conversation Timeline
1 comments
"Review active on #4325"
general
weight: 0.35
Acedus
What this PR does / why we need it:
I was cloning a lot of DataVolumes at once and it was way slower than it should be. A single CSI clone takes about a second, but 100 of them took minutes. The storage wasn't the problem. cdi-controller's Kubernetes client throttles itself (controller-runtime default is 20 QPS / 30 burst), and cdi-apiserver uses the client-go defaults (5 / 10). Goroutine dumps showed the reconcile workers sitting in
rate.(Limiter).Waitwhile the CPU was idle.This adds
-kube-api-qpsand-kube-api-burstto both cdi-controller and cdi-apiserver. They default to 0, which leaves the current limits alone, so nothing changes unless you set them. You can set them with the existingcustomizeComponents.flags, so no API change. I wrote it up indoc/client-rate-limits.md. The limits are applied to all the clients the components create, including the early ones in cdi-controller, not just the manager's.Numbers from cloning the same 120Gi block PVC 100 times on Pure FlashArray + Portworx, with
-kube-api-qps=100 -kube-api-burst=200:| | before | after |
|---|---|---|
| time to submit 100 DataVolumes | 56 s | 3.3 s |
| time to
Succeededper DV (paced creation) | median 27 s | median 1 s (max 3 s) ||
datavolume-pvc-clone-controlleravg reconcile | ~115 ms | ~7 ms ||
clone-populatoravg reconcile | ~334 ms | ~6.5 ms |The operator bug I found along the way (flags rendered in random order) is split out into #4327.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged)*:Refs #3470 (someone cloning 50 DataVolumes hit the same client-side throttling)
Special notes for your reviewer:
customizeComponents.flagsalready exists for this kind of tuning and it keeps the change small. A CR field could go on top later if you want one.pkg/util/clientconfig, so the importer and cloner binaries don't pull inclient-go/restthroughpkg/util.go build/go vet/gofmt. ThecustomizeComponents.flagspath is only covered by unit tests. On my cluster I set the flags with a static args patch because the deployed operator didn't have the ordering fix yet.BUILDfiles by hand. Running gazelle over the touched directories gives no diff, so they match what it would generate.Release note:
``
release-note
``Add -kube-api-qps and -kube-api-burst flags to cdi-controller and cdi-apiserver (settable through customizeComponents.flags) to tune the client-side rate limit for bulk operations.