-
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
Replace namespace include/exclude filter with label selector #1499
Comments
+1 this is honestly how we probably should have done it. @ingvagabund @knelasevero do you know any reason why we did the include/exclude pattern instead of just label selectors? |
We can not guarantee mutual exclusion of included and excluded namespaces with the whole expressiveness of |
@ingvagabund thanks for your answer, but it is puzzling. Are you saying that the feature will not be accepted because it is not a simple feature? What is with the use case then? What can you suggest go solve the issue? |
@ingvagabund if we get rid of the |
What you are saying makes sense. Still trying to recall why we decided to use combination of included/excluded namespaces. I can think of performance reasons. If we allow combination of
When the first expression matches most of the 10 000 namespaces it might take a while to enumerate the list. We have not made any performance measurements in big clusters (or clusters with many many namespaces) so it's all theoretical here. |
What we might do is to print a warning when the number of matched namespace exceeds certain limit (e.g. 1000) and warn a user the computation cost might get expensive. Worth checking how much time it takes to get those 1000 (and/or a different number(s)) matched namespaces. I wonder if there's a limit on the number of
E.g. the label selector might get automatically generated by a buggy generator with unchecked limits on the number of terms. Do we wanna introduce some limits on the number of terms here? |
Also, I wonder to what extend the fake clientset actually implements support for a field selector. The last time I checked it was not there. So when the descheduler gets to run in a dry mode we will need to implement the missing functionality. |
Is your feature request related to a problem? Please describe.
I have productive and test namespaces labeled accordingly (env: prod, env: test). I'd like to deschedule pods based on these labels. As of today, every time engineers create new namespace, it is required to go and change the rescheduled config as well.
This problem affects the ability to provide self-service for my teams.
Describe the solution you'd like
I'd like to see
namespaces.labelSelector
option which can filter namespaces based on labels. This is more flexible in all terms.Including and excluding namespaces by names (as it works now) can also be implemented using this option (so we no longer need include/exclude at all), e.g.,
equals to
Describe alternatives you've considered
--
What version of descheduler are you using?
descheduler version: latest
Additional context
The text was updated successfully, but these errors were encountered: