-
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
Descheduler not evicting pods with node selectors #524
Comments
Hi @gaurav1086, The reasoning is that if the pod's affinity only matches the current node, evicting it will not help any balancing because it will just be scheduled back onto the same node. See the code here: descheduler/pkg/descheduler/strategies/topologyspreadconstraint.go Lines 287 to 297 in 6b8d4cd
|
@damemi Thanks for the response. In our case, we have 3 eligible nodes with that (one) node selector say x=y where we are running a total of 15 pods. The current distribution is 7,5,3 . Expected output is: 5,5,5 . (Updated description above as well) Shouldn't the first condition in the if ( |
Ah, you are right. I think that is a bug. I will open a fix for this (Edit: PR opened here: #525) Could you also share an example pod yaml of one of the pods that should be evicted? |
What version of descheduler are you using?
descheduler version: v0.20.0
Does this issue reproduce with the latest release?
Yes
Which descheduler CLI options are you using?
N/A
Please provide a copy of your descheduler policy config file
What k8s version are you using (
kubectl version
)?kubectl version
OutputWhat did you do?
We tried to rebalance pods on a group of nodes with the same (and only 1) Node-Selector.
In our case, we have 3 eligible nodes with the node selector say x=y where we are running a total of 15 pods. The current pod distribution is 7,5,3 .
What did you expect to see?
The pods should be balanced. Expected pod distribution should be: 5,5,5 .
What did you see instead?
Descheduler refuses to evict pods from nodes with the following error in the logs:
{"level":"INFO","message":"\"Ignoring pod for eviction due to node selector/affinity\" pod=\"mypod\""}
The text was updated successfully, but these errors were encountered: