-
Notifications
You must be signed in to change notification settings - Fork 640
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
Added EvictSystemCriticalPods flag to descheduler #523
Added EvictSystemCriticalPods flag to descheduler #523
Conversation
Hi @RyanDevlin. 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. |
/assign @damemi |
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
looks all good to me, just squash those extra commits :)
987b6c9
to
91390d9
Compare
91390d9
to
6c16b0e
Compare
3ce4aa8
to
44ade23
Compare
test/e2e/e2e_test.go
Outdated
sort.Strings(initialPodNames) | ||
t.Logf("Existing pods: %v", initialPodNames) | ||
|
||
t.Logf("set the strategy to delete pods of any priority from %v namespace", namespace) |
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.
I'd prefer to delete a specific pod instead of deleting all pods in kube-system. E.g. create a fresh pod in kube-system with system critical class only which gets deleted.
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.
Because almost all the pods in kube-system are either daemonsets or static the only pods deleted are the dns pods. I had some trouble in the beginning writing the test because I tried to create my own system critical pods, but the API server gives an error when you try to make a pod with priority greater than 1 billion (1000000000). That's why, to test the capability of evicting pods with priority greater than 1000000000, I settled on deleting the dns pods in kube-system.
If you scroll to the right on the line below you can see I'm only looking for the kube-dns
pods to delete.
400 podList, err := clientSet.CoreV1().Pods(namespace).List(ctx, metav1.ListOptions{LabelSelector: labels.SelectorFromSet(map[string]string{"k8s-app": "kube-dns"}).String()})
Looking at line 409, I do see now that the log text should be changed. Other than that, do you think the test is okay? Or should I still try to create some sort of test pod?
44ade23
to
4d8e370
Compare
@ingvagabund I've adjusted my e2e tests to your specifications. All of my tests now reside in the I've also spent a lot of time testing and watching the pods be created by the e2e tests, and I've come up with a more elegant solution to the |
4d8e370
to
91a018b
Compare
Would it be easier to just poll the pod's statuses, rather than running the strategy repeatedly? Thinking that would use less resources |
This may actually hide problems since the descheduler runs each strategy only once (e.g. every hour). We can not assume running |
@RyanDevlin can you integrate 2b286d9 in your PR and see if it helps to avoid running |
@ingvagabund Not a problem! That looks like a good solution. I'm hoping to complete that work today. |
91a018b
to
d8bc1a4
Compare
d8bc1a4
to
b5d7219
Compare
@ingvagabund @damemi Thank you both for your suggestions. I've added @ingvagabund's elegant polling solution from 2b286d9 into my PR. Apologies in advance for the wall of text, but I wanted to provide some context to these changes. I spent a lot more time debugging these e2e tests. The solution from 2b286d9 didn't reliably work all the time for me. After further testing I discovered that every once in a while, a single RC pod would hang around. It would be I began to solve this issue by setting the This was when I discovered that the So currently the |
/lgtm @RyanDevlin thanks for the thorough investigation. The PR looks great!!! |
@ingvagabund Thanks for all the help! This was my first PR, I learned a lot. |
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
Thanks @RyanDevlin !
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: damemi, RyanDevlin 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 |
Ran "make gen" using Go 1.16.1. Some changes were merged, but "make gen" was not run. This fixes the problem. See below PR for reference: kubernetes-sigs#523
Added EvictSystemCriticalPods flag to descheduler
Ran "make gen" using Go 1.16.1. Some changes were merged, but "make gen" was not run. This fixes the problem. See below PR for reference: kubernetes-sigs#523
Fixes #378
The
evictSystemCriticalPods
flag disables priority checking by the descheduler. When this flag is true, pods of any priority are evicted, including system pods likekube-dns
. Daemonsets, Mirror Pods, Static Pods, and pods without owner references are not evicted when this flag is true. IfthresholdPriority
orthresholdPriorityClassName
are set, andevictSystemCriticalPods
is true, then the threshold priority filtering will be disabled.