Documentation ¶
Index ¶
- Constants
- Variables
- func EqualPriority(_ *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, ...) (schedulerapi.HostPriorityList, error)
- func NewGenericScheduler(cache schedulercache.Cache, predicates map[string]algorithm.FitPredicate, ...) algorithm.ScheduleAlgorithm
- func NewHTTPExtender(config *schedulerapi.ExtenderConfig, apiVersion string) (algorithm.SchedulerExtender, error)
- func PrioritizeNodes(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, ...) (schedulerapi.HostPriorityList, error)
- type Binder
- type Config
- type FailedPredicateMap
- type FitError
- type HTTPExtender
- type PodConditionUpdater
- type Scheduler
Constants ¶
const (
DefaultExtenderTimeout = 5 * time.Second
)
Variables ¶
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
Functions ¶
func EqualPriority ¶
func EqualPriority(_ *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodes []*api.Node) (schedulerapi.HostPriorityList, error)
EqualPriority is a prioritizer function that gives an equal weight of one to all nodes
func NewGenericScheduler ¶
func NewGenericScheduler(cache schedulercache.Cache, predicates map[string]algorithm.FitPredicate, prioritizers []algorithm.PriorityConfig, extenders []algorithm.SchedulerExtender) algorithm.ScheduleAlgorithm
func NewHTTPExtender ¶
func NewHTTPExtender(config *schedulerapi.ExtenderConfig, apiVersion string) (algorithm.SchedulerExtender, error)
func PrioritizeNodes ¶
func PrioritizeNodes( pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, priorityConfigs []algorithm.PriorityConfig, nodes []*api.Node, extenders []algorithm.SchedulerExtender, ) (schedulerapi.HostPriorityList, error)
Prioritizes the nodes by running the individual priority functions in parallel. Each priority function is expected to set a score of 0-10 0 is the lowest priority score (least preferred node) and 10 is the highest Each priority function can also have its own weight The node scores returned by the priority function are multiplied by the weights to get weighted scores All scores are finally combined (added) to get the total weighted scores of all nodes
Types ¶
type Config ¶
type Config struct { // It is expected that changes made via SchedulerCache will be observed // by NodeLister and Algorithm. SchedulerCache schedulercache.Cache NodeLister algorithm.NodeLister Algorithm algorithm.ScheduleAlgorithm Binder Binder // PodConditionUpdater is used only in case of scheduling errors. If we succeed // with scheduling, PodScheduled condition will be updated in apiserver in /bind // handler so that binding and setting PodCondition it is atomic. PodConditionUpdater PodConditionUpdater // NextPod should be a function that blocks until the next pod // is available. We don't use a channel for this, because scheduling // a pod may take some amount of time and we don't want pods to get // stale while they sit in a channel. NextPod func() *api.Pod // Error is called if there is an error. It is passed the pod in // question, and the error Error func(*api.Pod, error) // Recorder is the EventRecorder to use Recorder record.EventRecorder // Close this to shut down the scheduler. StopEverything chan struct{} }
type FailedPredicateMap ¶
type FailedPredicateMap map[string][]algorithm.PredicateFailureReason
type FitError ¶
type FitError struct { Pod *api.Pod FailedPredicates FailedPredicateMap }
type HTTPExtender ¶
type HTTPExtender struct {
// contains filtered or unexported fields
}
HTTPExtender implements the algorithm.SchedulerExtender interface.
func (*HTTPExtender) Filter ¶
func (h *HTTPExtender) Filter(pod *api.Pod, nodes []*api.Node) ([]*api.Node, schedulerapi.FailedNodesMap, error)
Filter based on extender implemented predicate functions. The filtered list is expected to be a subset of the supplied list. failedNodesMap optionally contains the list of failed nodes and failure reasons.
func (*HTTPExtender) Prioritize ¶
func (h *HTTPExtender) Prioritize(pod *api.Pod, nodes []*api.Node) (*schedulerapi.HostPriorityList, int, 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.
type PodConditionUpdater ¶
type PodConditionUpdater interface {
Update(pod *api.Pod, podCondition *api.PodCondition) error
}
Directories ¶
Path | Synopsis |
---|---|
Package scheduler contains a generic Scheduler interface and several implementations.
|
Package scheduler contains a generic Scheduler interface and several implementations. |
This package is used to register algorithm provider plugins.
|
This package is used to register algorithm provider plugins. |
defaults
This is the default algorithm provider for the scheduler.
|
This is the default algorithm provider for the scheduler. |
Package factory can set up a scheduler.
|
Package factory can set up a scheduler. |