Add --cache-sync-timeout flag to make CacheSyncTimeout configurable - #4856
Add --cache-sync-timeout flag to make CacheSyncTimeout configurable#4856itaibeny wants to merge 1 commit into
Conversation
On large clusters with many Services or Gateway API resources, the controller-runtime's hardcoded 2-minute CacheSyncTimeout causes the controller to crash-loop on startup because informer caches cannot sync in time. Wire the existing controller-runtime config.Controller.CacheSyncTimeout field through a new --cache-sync-timeout CLI flag (default: 2m, preserving current behavior). Also add the corresponding Helm chart value (cacheSyncTimeout) and documentation. Signed-off-by: Itai Ben-Yishai <itaibeny@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: itaibeny The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @itaibeny. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Issue
Fixes #4855
Description
On large clusters (~12,000 Services, ~2,000 HTTPRoutes) with
ALBGatewayAPI=true, the Gateway API controller's Service informer cache cannot sync within the hardcoded 2-minuteCacheSyncTimeoutfrom controller-runtime. This causes a crash-loop on startup:The timeout is already configurable in controller-runtime via
ctrl.Options.Controller.CacheSyncTimeout(seepkg/config/controller.go), but the LBC never exposes it. This PR wires it through:pkg/config/runtime_config.go— AddCacheSyncTimeoutfield toRuntimeConfig, register--cache-sync-timeoutflag viaBindFlags()(default:2m, preserving current behavior), and pass it intoopt.Controller.CacheSyncTimeoutinBuildRuntimeOptions().pkg/config/runtime_config_test.go— Unit tests for the flag default, custom values, and the wiring intoctrl.Options.docs/deploy/configurations.md— Addcache-sync-timeoutto the CLI flags table.helm/aws-load-balancer-controller/values.yaml— AddcacheSyncTimeoutvalue (empty = use controller default).helm/aws-load-balancer-controller/templates/deployment.yaml— Conditional--cache-sync-timeoutarg.Why this is safe: default behavior is unchanged (2 minutes), no new dependencies, the field already exists in controller-runtime — we're just wiring it through.
Checklist
README.md, or thedocsdirectory)