Regarding label filtering in descheduler

155 views
Skip to first unread message

Varma, Aman

unread,
Sep 2, 2021, 7:25:31 AM9/2/21
to kubernetes-s...@googlegroups.com

Hi,

 

I am working to integrate de-scheduler into one of our products which contains many different microservices under the same namespace. One of the requirement is that services should be able to opt out of de-scheduling if they don’t what their pods to get evicted.

 

To fulfil the above requirement, I considered using label filtering. Each service will have a label, using which it can opt-in for de-scheduling. However there are some strategies which do not support label filtering. While going through the code I realised that label filtering has been added to all strategies except LowNodeUtilization, HighNodeUtilization, RemoveDuplicates and RemovePodsViolatingTopologySpreadConstraint (commit link: Strategies: Add labelSelector to all strategies except LowNodeUtiliza… · kubernetes-sigs/descheduler@03518ba (github.com)).

 

Is there any specific reason why ‘Label Filtering’ is not supported in the above strategies by default? Locally, I have been able to make changes to support label filtering for RemoveDuplicates strategy and it looks to be working as expected. Should I add label filtering to other strategies also to fulfil my requirement? Or is there any better approach to fulfil my requirement?

 

Looking forward to your inputs.

 

Thanks and Regards,

Aman

 

 

Mike Dame

unread,
Sep 2, 2021, 8:56:29 AM9/2/21
to Varma, Aman, kubernetes-s...@googlegroups.com
Hi, there are a number of reasons that these strategies don't allow certain filtering options, mostly because filtering would interfere with their effective functioning.

This was first discussed in the PR that added pod label filtering: https://github.com/kubernetes-sigs/descheduler/pull/510

For the "NodeUtilization" strategies, their core intent is to operate on the entire cluster. Subsets of pods are better distributed using the TopologySpread strategy. There is some more detailed explanations for our decision behind these strategies in these Github issues (the reasoning is similar to why Namespace filtering is not available for NodeUtilization) [1][2][3]

However we have revisited some of these strategies after initially adding filtering options and found that they could also support certain filters. For example, we found that Namespace filtering does work for RemoveDuplicates[4]. So, if you would like to propose adding label filtering to some of these strategies please open an issue in the Descheduler repo (and feel free to link a PR with your changes as well!)

There also exists Priority Threshold filtering, which is available for all strategies because it allows all pods to be considered in each strategy's algorithm but just prevents eviction of those pods. This is usually a suitable alternative.

Hope this helps, thanks!


--
You received this message because you are subscribed to the Google Groups "kubernetes-sig-scheduling" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-sig-sch...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-sig-scheduling/DF4PR8401MB0665177C57D5272312F67A538CCE9%40DF4PR8401MB0665.NAMPRD84.PROD.OUTLOOK.COM.


--

Mike Dame

Sr. Software Engineer, OpenShift

Red Hat Westford, MA

GitHub: @damemi   

Varma, Aman

unread,
Sep 2, 2021, 9:30:52 AM9/2/21
to Mike Dame, kubernetes-s...@googlegroups.com

Hi Mike, thanks for the detailed response. I am looking for something that is available with all the strategies. So, I will try to work with Priority Threshold filtering.

 

Thanks,

Aman

Reply all
Reply to author
Forward
0 new messages