descheduler
descheduler copied to clipboard
Extend descheduler to support out-of-tree strategies
Is your feature request related to a problem? Please describe.
Now descheduler only supports the built-in strategies. If someone has their own strategies, they must fork this repo and modify the source code. It is not really elegant because when descheduler has been upgraded, they must rebase their codes and maybe fix some conflicts.
Describe the solution you'd like
I wanna add a registry factory in descheduler. Users only need to:
- Depend this repo in their own project.
- Implement the strategy interface of their own strategy as a plugin factory to tell
deschedulerto add the strategies. - Register the plugins as a parameter by calling
NewDeschedulerCommand.
The inspiration is from kube-scheduler out-of-tree plugin registry. The project scheduler-plugin is based on this cool function. It adds new scheduler plugins without modifying any source codes in kube-scheduler.
Describe alternatives you've considered
What version of descheduler are you using?
descheduler version:
Additional context
cc @damemi @ingvagabund
I think we've mentioned this idea before, but haven't formalized it. I like the idea of a descheduler framework modeled after the scheduler framework. And, most of the concepts are already established. I think along with a couple other ideas like https://github.com/kubernetes-sigs/descheduler/issues/646 https://github.com/kubernetes-sigs/descheduler/issues/586 and https://github.com/kubernetes-sigs/descheduler/issues/486 this could be a good time to start reviving the v1alpha2 proposal
Hey @damemi, just read the v1alpha2 proposal. Just wanted to propose a custom resource for the Strategy to implement custom strategies as mentioned in #686.
What I'm looking for is something like DeschedulerStrategy:
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerStrategy"
name: "MyCustomStrategy"
...
# just for an example, roughly written
podFilter:
filter: "FilterType"
with_namespaces:
- foo
without_namespaces:
- bar
label_selector: "baz"
strategy:
for_each: "node"
pods: "ListPodsOnANode"
when:
...
action:
...
So we can use the strategy in the DeschedulerPolicy:
apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
profiles:
- name: "my-custom-policy"
strategies:
"MyCustomStrategy"
...
...
Thoughts? 🤔
@Dentrax definitely a cool idea. Could you elaborate more on how you think a custom resource could be used? I worry the logic that could be expressed through a CRD for a custom strategy would be limited vs code
Comparing to the scheduler framework, that doesn't need additional CRDs for users to implement custom plugins. It's more hinged on the Plugin type being defined as an implementable interface.
Thanks!
I worry the logic that could be expressed through a CRD for a custom strategy would be limited vs code
Strongly agree here. It obvious that we could not achieve that extensibility by writing CRDs instead of code.
According to Kubernetes's extensible mental model, it would be great to make that strategies "extensible". I'm not so sure how we can achieve this in simple and minimal manner but CRD is one of the first things that i thought.
Maybe creating something like "Custom StrategyWebhook" could fit in pluggible system. It directly calls webhook using HTTP with predefined API spec, and tells to descheduler what to do if given condition is matched, for example.
Waiting your proposals & ideas!
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
/remove-lifecycle rotten see https://github.com/kubernetes-sigs/descheduler/issues/753#issuecomment-1116043835
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
/remove-lifecycle rotten /lifecycle frozen