Repository navigation
Disabling client-go rate-limiting if AP&F is enabled - #8757
cert-manager-prow[bot] merged 2 commits into
Conversation
8c32537 to
89865e3
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates cert-manager’s controller startup to detect whether Kubernetes API Priority & Fairness (AP&F) is enabled and, when it is, disable client-side QPS/burst rate limiting; it also loosens controller config validation to permit disabling rate limiting via -1.
Changes:
- Add an AP&F detection probe (
HEAD /livez/ping) and setrest.Config{QPS,Burst} = -1when AP&F is detected. - Add unit tests for AP&F detection behavior.
- Update controller configuration validation to allow
kubernetesAPIQPS/kubernetesAPIBurstvalues down to-1.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| pkg/controller/context.go | Adds AP&F detection and conditionally disables client-side rate limiting; introduces helper functions for probing. |
| pkg/controller/context_test.go | Adds tests covering AP&F detection scenarios and an invalid-host case. |
| internal/apis/config/controller/validation/validation.go | Adjusts validation logic to allow -1 for QPS/burst. |
| internal/apis/config/controller/validation/validation_test.go | Updates validation tests to reflect the new validation behavior/messages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
89865e3 to
9027060
Compare
|
/test pull-cert-manager-master-make-verify |
9027060 to
2d160a2
Compare
|
/test pull-cert-manager-master-make-verify |
Signed-off-by: Hemant Joshi <[email protected]>
2d160a2 to
8cd2ed9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
internal/apis/config/controller/validation/validation.go:58
- The validation change now explicitly allows
kubernetesAPIQPS/kubernetesAPIBurstto be-1(disable client-side rate limiting), butvalidation_test.goonly covers values less than-1being rejected. Please add a positive test case asserting thatQPS=-1andBurst=-1is accepted (no validation errors), so this new supported configuration is exercised.
if cfg.KubernetesAPIBurst < -1 {
allErrors = append(allErrors, field.Invalid(fldPath.Child("kubernetesAPIBurst"), cfg.KubernetesAPIBurst, "must be greater than or equal to -1"))
}
if cfg.KubernetesAPIQPS < -1 {
allErrors = append(allErrors, field.Invalid(fldPath.Child("kubernetesAPIQPS"), cfg.KubernetesAPIQPS, "must be greater than or equal to -1"))
}
if float32(cfg.KubernetesAPIBurst) < cfg.KubernetesAPIQPS {
allErrors = append(allErrors, field.Invalid(fldPath.Child("kubernetesAPIBurst"), cfg.KubernetesAPIBurst, "must be higher or equal to kubernetesAPIQPS"))
}
Co-authored-by: Copilot Autofix powered by AI <[email protected]> Signed-off-by: Hemant Joshi <[email protected]>
|
/label tide/merge-method-squash |
Pull Request Motivation
This PR aims to disable client side QPS and bursting if server side AP&F is enabled. AP&F or API Priority and Fairness handles server side overloading logic and is enabled by default since v1.20 and is v1 since v1.29. Here's more on this. The way we do this is we hit the server's ping endpoint and check if the flow control header is returned. If it's returned then we know its enabled (we don't care about the value of it).
This PR also takes care of setting QPS to -1 through controller config which was previously disabled because of validation logic.
Fixes #6890
Kind
/kind feature
Release Note