Documentation ¶
Index ¶
- Constants
- func NewSchedulerPlugin(_ context.Context, _ runtime.Object, handle framework.Handle) (framework.Plugin, error)
- type YuniKornSchedulerPlugin
- func (sp *YuniKornSchedulerPlugin) EventsToRegister() []framework.ClusterEventWithHint
- func (sp *YuniKornSchedulerPlugin) Filter(_ context.Context, _ *framework.CycleState, pod *v1.Pod, ...) *framework.Status
- func (sp *YuniKornSchedulerPlugin) Name() string
- func (sp *YuniKornSchedulerPlugin) PostBind(_ context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
- func (sp *YuniKornSchedulerPlugin) PreEnqueue(_ context.Context, pod *v1.Pod) *framework.Status
- func (sp *YuniKornSchedulerPlugin) PreFilter(_ context.Context, _ *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (sp *YuniKornSchedulerPlugin) PreFilterExtensions() framework.PreFilterExtensions
Constants ¶
const (
SchedulerPluginName = "YuniKornPlugin"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type YuniKornSchedulerPlugin ¶
YuniKornSchedulerPlugin provides an implementation of several lifecycle methods of the Kubernetes scheduling framework:
https://kubernetes.io/docs/concepts/scheduling-eviction/scheduling-framework/
PreFilter: Used to notify the default scheduler that a particular pod has been marked ready for scheduling by YuniKorn
Filter: Used to notify the default scheduler that a particular pod/node combination is ready to be scheduled
PostBind: Used to notify YuniKorn that a pod has been scheduled successfully
Pod Allocations:
The YuniKorn scheduler is always running in the background, making decisions about which pods to allocate to which nodes. When a decision is made, that pod is marked as having a "pending" pod allocation, which means YuniKorn has allocated the pod, but the default scheduler (via the plugin interface) has not yet been notified.
Once PreFilter() has been called for a particular pod, that allocation is marked as "in progress" meaning it has been communicated to the default scheduler, but has not yet been fulfilled.
Finally, in PostBind(), the allocation is removed as we now know that the pod has been allocated successfully. If a pending or in-progress allocation is detected for a pod in PreFilter(), we remove the allocation and force the pod to be rescheduled, as this means the prior allocation could not be completed successfully by the default scheduler for some reason.
func (*YuniKornSchedulerPlugin) EventsToRegister ¶
func (sp *YuniKornSchedulerPlugin) EventsToRegister() []framework.ClusterEventWithHint
func (*YuniKornSchedulerPlugin) Filter ¶
func (sp *YuniKornSchedulerPlugin) Filter(_ context.Context, _ *framework.CycleState, pod *v1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter is used to release specific pod/node combinations to scheduler
func (*YuniKornSchedulerPlugin) Name ¶
func (sp *YuniKornSchedulerPlugin) Name() string
Name returns the name of the plugin
func (*YuniKornSchedulerPlugin) PostBind ¶
func (sp *YuniKornSchedulerPlugin) PostBind(_ context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
PostBind is used to mark allocations as completed once scheduling run is finished
func (*YuniKornSchedulerPlugin) PreEnqueue ¶
PreEnqueue is called prior to adding Pods to activeQ
func (*YuniKornSchedulerPlugin) PreFilter ¶
func (sp *YuniKornSchedulerPlugin) PreFilter(_ context.Context, _ *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
PreFilter is used to release pods to scheduler
func (*YuniKornSchedulerPlugin) PreFilterExtensions ¶
func (sp *YuniKornSchedulerPlugin) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions is unused