-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add --watchers flag to allow controller to respond automatically to Ingress or Service updates #687
Add --watchers flag to allow controller to respond automatically to Ingress or Service updates #687
Conversation
95323c6
to
f8b3ddf
Compare
@jlamillan Thanks for the pull request. We'll look into it. |
f8b3ddf
to
068de95
Compare
Thanks @linki. Rebasing my your branch onto the latest... |
e93584a
to
f0a931a
Compare
f0a931a
to
de83bcb
Compare
Re-based again. @linki eagerly awaiting your thoughts and feedback here. We've been using this change for awhile and it's been working well for us. |
8ae3e21
to
eed4ed0
Compare
eed4ed0
to
384e95e
Compare
384e95e
to
0f03d33
Compare
/assign @Raffo |
I got no bandwidth for this right now, I have to push it to the new year (likely CW2, CW3). If someone wants to review this first, please go on. |
We'd be really interested in using informers too: in our mid-sized clusters (~1000 nodes, ~1500 services, ~1500 endpoints), generating endpoints takes ~5mn (the current code perform a lot of list pods calls, because we use headless services, which are heavy ones for the apiservers) If I understand the PR correctly, it just uses Informers to trigger a sync loop on events. What would be even better is to use the informer cache to store services and pods (and, yes possibly trigger a sync on update). In addition, using the pod objects is very inefficient compared to using endpoints (in which case we could native rely on pod Readiness instead of looking at the pod phase). If I understand correctly, we use pods for the publishHostIP case. Maybe we could use endpoints in general and fallback on pods for this specific use case? |
Good idea, I'll adjust the PR soon... |
Great, I can help if needed (and will definitely test) Another idea would be to have a resync period (to avoid getting in an inconsistent state over time) but to use a |
27ccc45
to
0fb60fb
Compare
634a0d7
to
02a8045
Compare
@lbernail, check out this branch, which updates ingress and service sources to use the informer cache instead of making API requests for ingresses and services/pods/nodes, respectively. If that change looks good, I could possibly submit that as a separate pull-request and use this pull-request to subsequently add the ability to have informers to trigger a sync loop on events via i.e. commit 1: Use k8s informer cache instead of active API server calls in ingress... |
/unassign @Raffo |
/assign @njuettner |
@jlamillan do you mind fixing the conflicting files and then I'm happy to merge it. |
29cc70e
to
e5d8857
Compare
Done @njuettner. As a reminder - |
@jlamillan can you fix the conflicts? |
7e735a0
to
29018c2
Compare
done. |
@jlamillan sorry again, do you mind fixing the conflicts again? |
29018c2
to
c324019
Compare
@njuettner: It seems that this has been rebased, and is ready to be merged. It would be a bit of a shame if @jlamillan would have to rebase again a 7th time. |
Sorry for the nudge @SEJeff / @njuettner , but we are also really looking forward to see this merged. |
Looks like the RunOnce signature was updated the other day. Resolving conflicts, rebasing, and testing... |
c324019
to
15c73f5
Compare
… on adds/updates/deletes for supported ingress and service sources.
15c73f5
to
fed2f0f
Compare
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.
lets merge it @jlamillan. thank you again for contributing, much appreciated!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jlamillan, njuettner 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 |
* Most of the changes for the user-guide section * Add follow up changes to user guide section
This change is related to issue #484. It builds on this pull-request, and introduces a new flag called
--events
that when enabled, adds the controller'sRun
function as the event handler so that it's automatically called when aService
and/orIngress
are updated. Note that these "event" driven calls are complementary to the regular polling calls that occur every--interval
. For example, we are experimenting with using--events
as a way to increase our--interval
while still being able to process updates toServices
andIngresses
quickly and using the interval to handle of band changes every hour or so.Some other notes:
BoundedFrequencyRunner
is being used to wrap the handler to limit calls toRunOnce
generated by events and to avoid a call toRunOnce
for every Service/Ingress on initial startup.Informer
is currently being set to0
to further avoid any unnecessary call-backs from theSharedInformers
unless a change has occurred. We can continue to rely on--interval
to handle regular syncs since not all sources support events.--events
is specified, any k8s client timeout is disabled to avoid periodic warning messages of timeouts that are caused by the persistent HTTP connection mechanism the informers use.