-
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
Filter by label #195
Comments
PR to resolve this at #202 |
/kind feature |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
The proposal has been reviewed by SIG scheduling and this feature can now be implemented. Descheduling by pod label will be implemented using a strategy parameter, not a CLI option. The Here is an example of what the YAML might look like:
The proposal document can be found here: https://bit.ly/k8s-descheduler-labels-namespaces @hanumanthan you had mentioned that you were interested in implementing this feature. Feel free to start working on it. Let us know if you have any questions. Let us know if you are able to work on this or not. Thanks! |
/assign @hanumanthan |
@seanmalloy I couldnt find the standard implementation for labels parsing. Can you please provide any doc or code for parsing labels.
|
@hanumanthan these links might be helpful, the example config is from the k8s docs on label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements So really the type that needs to be added to the config is just a |
@hanumanthan do you still want to work on this issue? There's a |
Yeah I will work on this weekend |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
Would be nice to have label filtering for namespaces too! |
Hi @hanumanthan, do you still plan to work on this? If not, I'm glad to pick this up. |
@lixiang233 I say go for it if you have the time. |
/unassign @hanumanthan |
This feature will be available in descheduler v0.21.0. |
I'm looking to filter pods by label before applying a descheduling strategy to them. This allows us to slice our descheduling operations helping with testing and with only descheduling workloads that are actively identified as deschedulable based on developer/operator knowledge. This should be opt in - i.e. with no label selector in the policy descheduler will work as now.
I'm happy to write a PR for this - but I wanted to ask for advice on where this logic should be implemented.
One option is in the ListEvictablePodsOnNode method, or one of its sub methods, - but it would need a change to the function signature which would break current uses of this package.
Another option is to implement the label selector with a call in every strategy. There's duplication of work here that may be tough to maintain in future.
A third option is to wrap the Kubernetes Client in an LabelledClient Interface that embeds the kubernetes.Interface but also holds a labelSelector. This could then be called in the ListEvictablePodsOnNode, but this requires a type assertion in that method.
I'd love to get some feedback on this - or any implementation ideas I might be missing.
The text was updated successfully, but these errors were encountered: