moirai

package
v0.0.0-...-d68d91a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in Registry and configurations.
	Name = "moirai"
)
View Source
const PreFilterKey framework.StateKey = "moirai.io/prefilter"

Variables

This section is empty.

Functions

func New

func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)

New initializes a new plugin and returns it.

func NewStateData

func NewStateData(name string, node string) framework.StateData

NewStateData returns a new state data object.

Types

type Plugin

type Plugin struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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) Name

func (p *Plugin) Name() string

Name returns name of the plugin.

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

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL