-
Notifications
You must be signed in to change notification settings - Fork 669
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
list pods assigned to a node by pod informer cache #673
Conversation
Signed-off-by: Garrybest <garrybest@foxmail.com>
Signed-off-by: Garrybest <garrybest@foxmail.com>
Signed-off-by: Garrybest <garrybest@foxmail.com>
Welcome @Garrybest! |
Hi @Garrybest. 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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions 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/test-infra repository. |
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.
/ok-to-test
@Garrybest you were faster sir :) #674 |
@Garrybest I need this change merged pretty soon. I have another PR on the way that relies on the pod lister and removing the field selector. What is your availability? |
Hi @ingvagabund, I'm totally available recently and I'm willing to make cooperations.😄 By the way, according to what @damemi said in #671 (comment), I have some experimental results and facts to show.
According to the first commit of my PR, I build a
Actually, the
Test method: Run
I think the benefit of this PR is very obvious. Note that this test is only listing once. If we enable all plugins, the accelerate rate will be a very large number since the listing of all nodes will be called more than once. |
This PR is well done!!! @Garrybest thank you. I like the changes you made to the code. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Garrybest, ingvagabund 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 |
list pods assigned to a node by pod informer cache
What this PR does / why we need it:
Now there is a perf problem about the way we list pods that assigned to a node. When the cluster is large scale, like 3k+ nodes and 90k+ pods. The descheduler is not able to work because every interval it will request kube-apiserver for almost 30k+ times(enable 10 plugins and every plugins request for 3k+ times) with a FieldSelector. Meanwhile, it leads to a lot of pressure for kube-apiserver. So I try to make a revision by using pod informer cache.
Which issue(s) this PR fixes:
Fixes #671
Special notes for your reviewer:
I'm afraid the PR is too large to review (beacause listing pods is a really basic action and the function is called everywhere in strategy files and test files). So I separate this PR into 3 commits in order to make code review easier.😄
Reform ListPodsOnANode by using pod informer and indexer
This commit is the most important one. The code is very concise. I establish an indexer to map the pods and their assigned nodes by an informer indexer. So every time we list pods we could use informer cache instead of requesting
kube-apiserver
by filed selectors.Reform all strategies by using getPodsAssignedToNode
This commit let all other files of descheduler adapt to listing pods by function
getPodsAssignedToNode
. Not so important, just some adaptions.Reform all test files
This commit is not important. Just a lot of adaptions of test files and it took me a lot of time to do the adaptions (cause the test cases and strategies are so many). 🤣