How to develop custom scheduler plugin

576 views
Skip to first unread message

Seong Moon

unread,
Dec 4, 2020, 4:15:58 AM12/4/20
to kubernetes-sig-scheduling
Hi ! Everyone !

I'm very excited to find out the scheduler framework.
Thanks very much to the persons have contributed the scheduler framework.

Now, I'm trying to implement our custom scheduler plugin using the scheduler framework.
But, I can't find any documents for developers like me.

I found the following github hosting out-of-tree scheduler plugins.
But, there is no detailed documents about how to use and test.

I can't find any place to ask this.
Would you guide me how to start the development of my custom scheduler plugin using the scheduler framework ?

Thanks in advance.
Regards seong.


Mike Dame

unread,
Dec 4, 2020, 9:04:24 AM12/4/20
to Seong Moon, kubernetes-sig-scheduling
Hi,
The best way to implement a custom plugin is to write a custom scheduler, which can be done in a few lines of code using the functions NewSchedulerCommand and WithPlugin. This way, the framework will pull in all of the default plugins for you in addition to registering your custom plugin in a simple manageable codebase.

That scheduler-plugins repository is actually itself an example of how to implement custom scheduler plugins with the scheduler framework. It builds an entire custom scheduler and loads in custom plugins using WithPlugin() (see https://github.com/kubernetes-sigs/scheduler-plugins/blob/feee9e705559f3e8746d369cc04a81721c2afe65/cmd/scheduler/main.go#L43-L50).

For more detailed documentation on using the framework, I would recommend reading the enhancement (specifically the section on "out-of-tree plugins": https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/624-scheduling-framework/README.md).

Hope this helps :)

--
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/05b0ea7d-5c63-442c-a20f-25ab6f48e67cn%40googlegroups.com.


--

Mike Dame

Sr. Software Engineer, OpenShift

Red Hat Westford, MA

GitHub: @damemi   

Aldo Culquicondor

unread,
Dec 4, 2020, 10:58:07 AM12/4/20
to Mike Dame, Seong Moon, kubernetes-sig-scheduling
I would recommend reading https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/ more than the KEP, to learn about the capabilities of the framework.

And, as already said, the scheduling-plugins repo is a living example on how to write plugins. But I agree that it lacks high level documentation. Feel free to open PRs against it to improve the README.

As for the k8s in-tree plugins, this is the place were we intend to have living documentation https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/framework/plugins/README.md

Aldo


Reply all
Reply to author
Forward
0 new messages