Documentation ¶
Index ¶
- Constants
- func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- func NewStateData(name string, node string) framework.StateData
- type Plugin
- func (p *Plugin) EventsToRegister() []framework.ClusterEvent
- func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
- func (p *Plugin) Name() string
- func (p *Plugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Permit(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (*framework.Status, time.Duration)
- func (p *Plugin) PostBind(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...)
- func (p *Plugin) PostFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (p *Plugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
- func (p *Plugin) PreScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Reserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) *framework.Status
- func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...) (int64, *framework.Status)
- func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
- func (p *Plugin) Unreserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, ...)
Constants ¶
const (
// Name is the name of the plugin used in Registry and configurations.
Name = "moirai"
)
const PreFilterKey framework.StateKey = "moirai.io/prefilter"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Plugin ¶
Plugin is a scheduling plugin for Moirai.
func (*Plugin) EventsToRegister ¶
func (p *Plugin) EventsToRegister() []framework.ClusterEvent
EventsToRegister returns a series of possible events that may cause a Pod failed by this plugin schedulable.
func (*Plugin) Filter ¶
func (p *Plugin) Filter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status
Filter is called by the scheduling framework.
func (*Plugin) Less ¶
func (p *Plugin) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
Less are used to sort pods in the scheduling queue.
func (*Plugin) NormalizeScore ¶
func (p *Plugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status
NormalizeScore is called for each scored node. From https://github.com/Azure/placement-policy-scheduler-plugins/blob/main/pkg/plugins/placementpolicy/placementpolicy.go
func (*Plugin) Permit ¶
func (p *Plugin) Permit(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (*framework.Status, time.Duration)
Permit is called before binding a pod (and before prebind plugins). Permit plugins are used to prevent or delay the binding of a Pod.
func (*Plugin) PostBind ¶
func (p *Plugin) PostBind(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string)
PostBind is called after a pod is successfully bound.
func (*Plugin) PostFilter ¶
func (p *Plugin) PostFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)
PostFilter is called by the scheduling framework. Preemption
func (*Plugin) PreFilter ¶
func (p *Plugin) PreFilter(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)
PreFilter is called at the beginning of the scheduling cycle. All PreFilter plugins must return success or the pod will be rejected.
func (*Plugin) PreFilterExtensions ¶
func (p *Plugin) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions is an interface that is included in plugins that allow specifying callbacks to make incremental updates to its supposedly pre-calculated state.
func (*Plugin) PreScore ¶
func (p *Plugin) PreScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodes []*corev1.Node) *framework.Status
PreScore is called by the scheduling framework after a list of nodes passed the filtering phase. All prescore plugins must return success or the pod will be rejected
func (*Plugin) Reserve ¶
func (p *Plugin) Reserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) *framework.Status
Reserve is called by the scheduling framework when the scheduler cache is updated.
func (*Plugin) Score ¶
func (p *Plugin) Score(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)
Score is called on each filtered node. It must return success and an integer indicating the rank of the node. All scoring plugins must return success or the pod will be rejected.
func (*Plugin) ScoreExtensions ¶
func (p *Plugin) ScoreExtensions() framework.ScoreExtensions
ScoreExtensions is an interface for Score extended functionality.
func (*Plugin) Unreserve ¶
func (p *Plugin) Unreserve(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, nodeName string)
Unreserve is called by the scheduling framework when a reserved pod was rejected, an error occurred during reservation of subsequent plugins, or in a later phase.