scheduler

package
v0.0.0-...-55e4108 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2019 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BindEvent

type BindEvent struct {
	Pod            *v1.Pod
	ScheduleResult core.ScheduleResult
}

BindEvent represents an event of deciding the binding of a pod to a node.

func (*BindEvent) IsSchedulerEvent

func (b *BindEvent) IsSchedulerEvent() bool

type DeleteEvent

type DeleteEvent struct {
	PodNamespace string
	PodName      string
	NodeName     string
}

DeleteEvent represents an event of the deleting a bound pod on a node.

func (*DeleteEvent) IsSchedulerEvent

func (d *DeleteEvent) IsSchedulerEvent() bool

type Event

type Event interface {
	IsSchedulerEvent() bool
}

Event defines the interface of a scheduling event. Submit can returns any type in a list that implements this interface.

type Extender

type Extender struct {
	// Name identifies this Extender.
	Name string

	// Filter filters out the nodes that cannot run the given pod in api.ExtenderArgs.
	// This function can be nil.
	Filter func(api.ExtenderArgs) api.ExtenderFilterResult

	// Prioritize ranks each node that has passes the filtering stage.
	// The weighted scores are summed up and the total score is used for the node selection.
	Prioritize func(api.ExtenderArgs) api.HostPriorityList
	Weight     int

	// NodeCacheCapable specifies that this Extender is capable of caching node information, so the
	// scheduler should only send minimal information about the eligible nodes assuming that the
	// extender already cached full details of all nodes in the cluster.
	// Specifically, ExtenderArgs.NodeNames is populated iff NodeCacheCapable == true, and
	// ExtenderArgs.Nodes.Items is populated iff NodeCacheCapable == false.
	NodeCacheCapable bool

	// Ignorable specifies whether the extender is ignorable (i.e. the scheduler process should not
	// fail when this extender returns an error).
	Ignorable bool
}

Extender reperesents a scheduler extender.

type GenericScheduler

type GenericScheduler struct {
	// contains filtered or unexported fields
}

GenericScheduler makes scheduling decision for each given pod in the one-by-one manner. This type is similar to "k8s.io/pkg/Scheduler/Scheduler/core".genericScheduler, which implements "k8s.io/pkg/Scheduler/Scheduler/core".ScheduleAlgorithm.

func NewGenericScheduler

func NewGenericScheduler(preeptionEnabled bool) GenericScheduler

NewGenericScheduler creates a new GenericScheduler.

func (*GenericScheduler) AddExtender

func (sched *GenericScheduler) AddExtender(extender Extender)

AddExtender adds an extender to this GenericScheduler.

func (*GenericScheduler) AddPredicate

func (sched *GenericScheduler) AddPredicate(name string, predicate predicates.FitPredicate)

AddPredicate adds a predicate plugin to this GenericScheduler.

func (*GenericScheduler) AddPrioritizer

func (sched *GenericScheduler) AddPrioritizer(prioritizer priorities.PriorityConfig)

AddPrioritizer adds a prioritizer plugin to this GenericScheduler.

func (*GenericScheduler) Schedule

func (sched *GenericScheduler) Schedule(
	clock clock.Clock,
	pendingPods queue.PodQueue,
	nodeLister algorithm.NodeLister,
	nodeInfoMap map[string]*nodeinfo.NodeInfo) ([]Event, error)

Schedule implements Scheduler interface. Schedules pods in one-by-one manner by using registered extenders and plugins.

type Scheduler

type Scheduler interface {
	// Schedule makes scheduling decisions for (subset of) pending pods and running pods.
	// The return value is a list of scheduling events.
	// This method must never block.
	Schedule(
		clock clock.Clock,
		podQueue queue.PodQueue,
		nodeLister algorithm.NodeLister,
		nodeInfoMap map[string]*nodeinfo.NodeInfo) ([]Event, error)
}

Scheduler defines the lowest-level scheduler interface.

Jump to

Keyboard shortcuts

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