scheduler

package
v0.0.0-...-d4c82a0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BindTimeoutSeconds defines the default bind timeout
	BindTimeoutSeconds = 100
	// SchedulerError is the reason recorded for events when an error occurs during scheduling a pod.
	SchedulerError = "SchedulerError"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConflictReason

type ConflictReason string
const (
	// ErrReasonBindConflict is used for VolumeBindingNoMatch predicate error.
	ErrReasonBindConflict ConflictReason = "node(s) didn't find available persistent volumes to bind"
	// ErrReasonNodeConflict is used for VolumeNodeAffinityConflict predicate error.
	ErrReasonNodeConflict ConflictReason = "node(s) had volume node affinity conflict"
)

type ConflictReasons

type ConflictReasons []ConflictReason

type ScheduleResult

type ScheduleResult struct {

	// Name of the scheduler suggest host
	SuggestedHost string

	// Pod to terminate (Only used in preemption)
	NorminatedPod *v1.Pod
}

Contains the suggested host to schedule a pod and if preemption is required the name of the norminated pod.

type Scheduler

type Scheduler struct {

	// It is expected that changes made via SchedulerCache will be observed
	// by NodeLister and Algorithm.
	SchedulerCache internalcache.Cache

	// Disable pod preemption or not.
	DisablePreemption bool
	// contains filtered or unexported fields
}

Scheduler is responsible for scheduling pods

func New

func New(
	volumeBinder scheduling.SchedulerVolumeBinder,
	client clientset.Interface,
	cache internalcache.Cache,
	kubefactory informers.SharedInformerFactory,
	node_lister corelisters.NodeLister,
	pod_lister corelisters.PodLister,
	disablePreemption bool,
	percentageNodeScore int,
) (*Scheduler, error)

Create new scheduler object

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(con context.Context, pod *v1.Pod) (scheduleResult ScheduleResult, err error)

Invokes the scheduling routine

type SchedulerVolumeBinder

type SchedulerVolumeBinder interface {
	// FindPodVolumes checks if all of a Pod's PVCs can be satisfied by the node.
	FindPodVolumes(pod *v1.Pod, node *v1.Node) (reasons ConflictReasons, err error)
}

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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