-
Notifications
You must be signed in to change notification settings - Fork 595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sleep-based synchronization between cache warmup and the first sync to Kong #2249
Comments
Between the above and conversation with controller-runtime devs, I think the only option that solves this completely is to remove the secondary cache, i.e remove most of the store package functionality and replace it with something that uses the same client as the Manager, at which point we can just call I expect this also obsoletes all the individual controllers other than GWAPI controllers, which have other tasks beyond making resources available to the store/parser. |
The PoC in #2250 indicates that we should be able to rework the store to use the manager client. The PoC injects the manager client into a specific store function to support it and the traditional approach in the other functions, but ultimately we'd use it to replace the Parser and store tests will need to be reworked to stuff their objects into https://pkg.go.dev/sigs.k8s.io/controller-runtime/pkg/client/fake |
Insert a 5-second delay in the proxy start function. This allows time for the controllers to populate the proxy cache before the first sync, as a temporary mitigation for #2249.
Insert a 5-second delay in the proxy start function. This allows time for the controllers to populate the proxy cache before the first sync, as a temporary mitigation for #2249. Add unreleased 2.2.1 changelog entry. Add missing 2.2.0 changelog TOC entry.
Insert a 5-second delay in the proxy start function. This allows time for the controllers to populate the proxy cache before the first sync, as a temporary mitigation for #2249. Add unreleased 2.2.1 changelog entry. Add missing 2.2.0 changelog TOC entry. Co-authored-by: Shane Utt <[email protected]>
Closed in favor of #2315 |
Is there an existing issue for this?
Current Behavior
After acquiring a leadership lease, the manager starts all controllers and the sync loop. The controllers begin populating the proxy cache with the current set of resources available from the API server, and the sync loop begins syncing. The proxy cache is initially empty, so its first sync will attempt to reconcile an empty target state, deleting existing resources, and then create them again on the next sync:
Note that while we have reconciled the resource before the
deleting route
log from deck, that deck log fires after the sync loop has actually determined the target state. We don't have further logging in the sync loop that would tell us the exact time it finalized the state to sync.Expected Behavior
KIC leaves Kong resources that represent Kubernetes resources present at the time KIC gains leadership in place.
Steps To Reproduce
Kong Ingress Controller version
Kubernetes version
No response
Anything else?
This behavior was present prior to 2.1, but was not observed because defaults usually meant that all instances ran with leader election disabled. #2053 fixed some issues with leader election and made it the only option for DB-backed instances.
Initial review does not offer obvious easy solutions:
Reconcile()
on a timer.The text was updated successfully, but these errors were encountered: