framework

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Code

type Code int

Code is the Status code/type which is returned from plugins.

const (
	// Success means that plugin ran correctly and found pod schedulable.
	// NOTE: A nil status is also considered as "Success".
	Success Code = iota
	// Error is used for internal plugin errors, unexpected input, etc.
	Error
	// Unschedulable is used when a plugin finds a pod unschedulable. The scheduler might attempt to
	// preempt other pods to get this pod scheduled. Use UnschedulableAndUnresolvable to make the
	// scheduler skip preemption.
	// The accompanying status message should explain why the pod is unschedulable.
	Unschedulable
	// UnschedulableAndUnresolvable is used when a PreFilter plugin finds a pod unschedulable and
	// preemption would not change anything. Plugins should return Unschedulable if it is possible
	// that the pod can get scheduled with preemption.
	// The accompanying status message should explain why the pod is unschedulable.
	UnschedulableAndUnresolvable
	// Wait is used when a Permit plugin finds a pod scheduling should wait.
	Wait
	// Skip is used when a Bind plugin chooses to skip binding.
	Skip
)

type FilterPlugin

type FilterPlugin interface {
	Plugin

	Filter(ctx context.Context, QueueUnit *QueueUnitInfo) *Status
}

type Framework

type Framework interface {
	// QueueSortFunc returns the function to sort pods in scheduling queue
	MultiQueueSortFunc() MultiQueueLessFunc
	QueueSortFuncMap() map[string]QueueLessFunc
	RunFilterPlugins(context.Context, *QueueUnitInfo) *Status
	RunScorePlugins(context.Context) (int64, bool)
	RunReservePluginsReserve(context.Context, *QueueUnitInfo) *Status
	RunReservePluginsUnreserve(context.Context, *QueueUnitInfo)
}

type Handle

type Handle interface {
	SharedInformerFactory() informers.SharedInformerFactory
	KubeConfigPath() string
	QueueUnitClient() *versioned.Clientset
}

type MultiQueueLessFunc

type MultiQueueLessFunc func(*QueueInfo, *QueueInfo) bool

type MultiQueueSortPlugin

type MultiQueueSortPlugin interface {
	Plugin
	MultiQueueLess(*QueueInfo, *QueueInfo) bool
}

type Plugin

type Plugin interface {
	Name() string
}

Plugin is the parent type for all the scheduling framework plugins.

type QueueInfo

type QueueInfo struct {
	Name     string
	Priority int32
	Queue    *v1alpha1.Queue
}

QueueInfo is a Queue wrapper with additional information related to the Queue

type QueueLessFunc

type QueueLessFunc func(*QueueUnitInfo, *QueueUnitInfo) bool

type QueueSortPlugin

type QueueSortPlugin interface {
	Plugin
	QueueLess(*QueueUnitInfo, *QueueUnitInfo) bool
}

type QueueUnitInfo

type QueueUnitInfo struct {
	// Name is namespace + "/" + name
	Name string
	Unit *v1alpha1.QueueUnit
	// The time QueueUnit added to the scheduling queue.
	Timestamp time.Time
	// Number of schedule attempts before successfully scheduled.
	Attempts int
	// The time when the QueueUnit is added to the queue for the first time.
	InitialAttemptTimestamp time.Time
}

QueueUnitInfo is a Queue wrapper with additional information related to the QueueUnit

func NewQueueUnitInfo

func NewQueueUnitInfo(unit *v1alpha1.QueueUnit) *QueueUnitInfo

NewQueueUnitInfo constructs QueueUnitInfo

type ReservePlugin

type ReservePlugin interface {
	Plugin
	Reserve(ctx context.Context, QueueUnit *QueueUnitInfo) *Status
	Unreserve(ctx context.Context, QueueUnit *QueueUnitInfo)
}

type ScorePlugin

type ScorePlugin interface {
	Plugin
	Score(ctx context.Context, p *v1.Pod) (int64, bool)
}

ScorePlugin is an interface that must be implemented by "Score" plugins to rank nodes that passed the filtering phase.

type Status

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

func NewStatus

func NewStatus(code Code, message string) *Status

NewStatus makes a Status out of the given arguments and returns its pointer.

func (*Status) Code

func (s *Status) Code() Code

func (*Status) Message

func (s *Status) Message() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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