core

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultExtenderTimeout defines the default extender timeout in second.
	DefaultExtenderTimeout = 5 * time.Second
)

Variables

View Source
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")

ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods.

Functions

func Equal added in v1.17.0

func Equal(e1, e2 *HTTPExtender) bool

Equal is used to check if two extenders are equal ignoring the client field, exported for testing

func NewHTTPExtender

func NewHTTPExtender(config *schedulerapi.Extender) (framework.Extender, error)

NewHTTPExtender creates an HTTPExtender object.

Types

type HTTPExtender

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

HTTPExtender implements the Extender interface.

func (*HTTPExtender) Bind

func (h *HTTPExtender) Bind(binding *v1.Binding) error

Bind delegates the action of binding a pod to a node to the extender.

func (*HTTPExtender) Filter

func (h *HTTPExtender) Filter(
	pod *v1.Pod,
	nodes []*v1.Node,
) (filteredList []*v1.Node, failedNodes, failedAndUnresolvableNodes extenderv1.FailedNodesMap, err error)

Filter based on extender implemented predicate functions. The filtered list is expected to be a subset of the supplied list; otherwise the function returns an error. The failedNodes and failedAndUnresolvableNodes optionally contains the list of failed nodes and failure reasons, except nodes in the latter are unresolvable.

func (*HTTPExtender) IsBinder

func (h *HTTPExtender) IsBinder() bool

IsBinder returns whether this extender is configured for the Bind method.

func (*HTTPExtender) IsIgnorable added in v1.11.0

func (h *HTTPExtender) IsIgnorable() bool

IsIgnorable returns true indicates scheduling should not fail when this extender is unavailable

func (*HTTPExtender) IsInterested

func (h *HTTPExtender) IsInterested(pod *v1.Pod) bool

IsInterested returns true if at least one extended resource requested by this pod is managed by this extender.

func (*HTTPExtender) Name added in v1.13.0

func (h *HTTPExtender) Name() string

Name returns extenderURL to identify the extender.

func (*HTTPExtender) Prioritize

func (h *HTTPExtender) Prioritize(pod *v1.Pod, nodes []*v1.Node) (*extenderv1.HostPriorityList, int64, error)

Prioritize based on extender implemented priority functions. Weight*priority is added up for each such priority function. The returned score is added to the score computed by Kubernetes scheduler. The total score is used to do the host selection.

func (*HTTPExtender) ProcessPreemption added in v1.11.0

func (h *HTTPExtender) ProcessPreemption(
	pod *v1.Pod,
	nodeNameToVictims map[string]*extenderv1.Victims,
	nodeInfos framework.NodeInfoLister,
) (map[string]*extenderv1.Victims, error)

ProcessPreemption returns filtered candidate nodes and victims after running preemption logic in extender.

func (*HTTPExtender) SupportsPreemption added in v1.11.0

func (h *HTTPExtender) SupportsPreemption() bool

SupportsPreemption returns true if an extender supports preemption. An extender should have preempt verb defined and enabled its own node cache.

type ScheduleAlgorithm added in v1.14.0

type ScheduleAlgorithm interface {
	Schedule(context.Context, framework.Framework, *framework.CycleState, *v1.Pod) (scheduleResult ScheduleResult, err error)
	// Extenders returns a slice of extender config. This is exposed for
	// testing.
	Extenders() []framework.Extender
}

ScheduleAlgorithm is an interface implemented by things that know how to schedule pods onto machines. TODO: Rename this type.

func NewGenericScheduler

func NewGenericScheduler(
	cache internalcache.Cache,
	nodeInfoSnapshot *internalcache.Snapshot,
	extenders []framework.Extender,
	percentageOfNodesToScore int32) ScheduleAlgorithm

NewGenericScheduler creates a genericScheduler object.

type ScheduleResult added in v1.14.0

type ScheduleResult struct {
	// Name of the scheduler suggest host
	SuggestedHost string
	// Number of nodes scheduler evaluated on one pod scheduled
	EvaluatedNodes int
	// Number of feasible nodes on one pod scheduled
	FeasibleNodes int
}

ScheduleResult represents the result of one pod scheduled. It will contain the final selected Node, along with the selected intermediate information.

Jump to

Keyboard shortcuts

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