-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🏃 Use controller-runtime cache for watching remote nodes over informers #2496
🏃 Use controller-runtime cache for watching remote nodes over informers #2496
Conversation
4f4ef09
to
d2ceaf9
Compare
I've manually tested this change doesn't break the remote watching of nodes, could see reconciliation occurring at the same timestamp as the node condition |
d2ceaf9
to
0db5717
Compare
/milestone v0.3.x |
factory := informers.NewSharedInformerFactory(k8sClient, 0) | ||
nodeInformer := factory.Core().V1().Nodes().Informer() | ||
go nodeInformer.Run(ctx.Done()) | ||
go clusterCache.Start(ctx.Done()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xref #2577: I think we're going to need to able to stop a cache when the associated Cluster is deleted. This probably means creating a stop channel per cache and tracking it in the map, and adding logic that closes the stop channel for a cache if its corresponding Cluster is not found when reconciling.
@JoelSpeed https://github.com/kubernetes-sigs/controller-runtime/releases new controller runtime release is up |
0db5717
to
092ee97
Compare
Thanks @vincepri for the ping. I've updated the PR to update the dependencies to the new patch release. Put this as a separate commit for now, wasn't sure whether it was ok to just merge in with this of if it should be separate for some reason? |
/milestone v0.3.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JoelSpeed, vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@ncdc did you want to take a final look here? |
Sure, on it now |
/lgtm |
/retitle 🏃 Use controller-runtime cache for watching remote nodes over informers |
What this PR does / why we need it:
As per suggestion in #2250, the watching of remote nodes could be improved by the introduction of the a
KindWithCache
source from controller-runtime. This feature is not yet released however. Once the next release of controller-runtime is made, and the project is happy to bump the dependency, this PR can be updated and the improvements mergedWhich issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2412