-
Notifications
You must be signed in to change notification settings - Fork 9.8k
refactor(endpointslice): use service cache.Indexer to achieve better iteration performance #16365
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
Conversation
@brancz Hi, could you please take a look at this PR? Does it meet expectations? |
CI / More Go tests failed because of the error below, which looks like has nothing to do with my PR?
|
@machine424 Please help confirm if this PR makes any sense when you got some free time. |
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.
thanks for this.
Some comments.
We'll need to give this a try on a real kube cluster, let's discuss that once we're happy with the code.
1a215c9
to
abb0834
Compare
@machine424 After
I debug locally and find
|
For best practice considerations, i'm still willing to use |
I should have been more explicit. It's true that the service informer is namespaced prometheus/discovery/kubernetes/kubernetes.go Line 411 in b4526c0
prometheus/discovery/kubernetes/kubernetes.go Line 271 in b4526c0
So, for some setups, a change to a service with the same name but from another namespace could still enqueue
having services with the same name across different namespaces may not be that common, but it's always good to avoid that unnecessary work. The test So let's do this in two steps:
|
@machine424 Really appreciate your explanation and suggestions. I've make another PR to Make |
could you rebase? |
… LabelServiceName so not have to iterate over all endpoint objects. Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
…hUnrelatedServiceUpdate' unit test to give a regression test Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
35cad48
to
6a07992
Compare
Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
@machine424 Rebase is done. I just made another commit to make service indexer namesapced. Pls take a look to see if it makes sense. |
Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
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.
lgtm, thanks again!
just some nits.
Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com> Signed-off-by: Ryan Wu <rongjun0821@gmail.com>
Suggestions applied. Thanks. |
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.
lgtm, thanks again!
Well, I even approved it twice, there couldn't be anything wrong with it :) |
try to solve the TODO: