Documentation ¶
Index ¶
- Constants
- Variables
- func EqualPriorityMap(_ *v1.Pod, _ interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error)
- func NewGenericScheduler(cache schedulercache.Cache, predicates map[string]algorithm.FitPredicate, ...) algorithm.ScheduleAlgorithm
- func NewHTTPExtender(config *schedulerapi.ExtenderConfig) (algorithm.SchedulerExtender, error)
- func PrioritizeNodes(pod *v1.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, ...) (schedulerapi.HostPriorityList, error)
- type AlgorithmCache
- type EquivalenceCache
- func (ec *EquivalenceCache) AddPodPredicatesCache(pod *v1.Pod, fitNodeList []*v1.Node, failedPredicates *FailedPredicateMap)
- func (ec *EquivalenceCache) GetCachedPredicates(pod *v1.Pod, nodes []*v1.Node) ([]*v1.Node, FailedPredicateMap, []*v1.Node)
- func (ec *EquivalenceCache) SendClearAllCacheReq()
- func (ec *EquivalenceCache) SendInvalidAlgorithmCacheReq(nodeName string)
- type FailedPredicateMap
- type FitError
- type HTTPExtender
- type HostPredicate
Constants ¶
const (
DefaultExtenderTimeout = 5 * time.Second
)
const NoNodeAvailableMsg = "No nodes are available that match all of the following predicates:"
Variables ¶
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
Functions ¶
func EqualPriorityMap ¶
func EqualPriorityMap(_ *v1.Pod, _ interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, 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, predicateMetaProducer algorithm.MetadataProducer, prioritizers []algorithm.PriorityConfig, priorityMetaProducer algorithm.MetadataProducer, extenders []algorithm.SchedulerExtender) algorithm.ScheduleAlgorithm
func NewHTTPExtender ¶
func NewHTTPExtender(config *schedulerapi.ExtenderConfig) (algorithm.SchedulerExtender, error)
func PrioritizeNodes ¶
func PrioritizeNodes( pod *v1.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, meta interface{}, priorityConfigs []algorithm.PriorityConfig, nodes []*v1.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 AlgorithmCache ¶
type AlgorithmCache struct {
// contains filtered or unexported fields
}
type EquivalenceCache ¶
Store a map of predicate cache with maxsize
func NewEquivalenceCache ¶
func NewEquivalenceCache(getEquivalencePodFunc algorithm.GetEquivalencePodFunc) *EquivalenceCache
func (*EquivalenceCache) AddPodPredicatesCache ¶
func (ec *EquivalenceCache) AddPodPredicatesCache(pod *v1.Pod, fitNodeList []*v1.Node, failedPredicates *FailedPredicateMap)
AddPodPredicatesCache cache pod predicate for equivalence class
func (*EquivalenceCache) GetCachedPredicates ¶
func (ec *EquivalenceCache) GetCachedPredicates(pod *v1.Pod, nodes []*v1.Node) ([]*v1.Node, FailedPredicateMap, []*v1.Node)
GetCachedPredicates gets cached predicates for equivalence class
func (*EquivalenceCache) SendClearAllCacheReq ¶
func (ec *EquivalenceCache) SendClearAllCacheReq()
SendClearAllCacheReq marks all cached item as invalid
func (*EquivalenceCache) SendInvalidAlgorithmCacheReq ¶
func (ec *EquivalenceCache) SendInvalidAlgorithmCacheReq(nodeName string)
SendInvalidAlgorithmCacheReq marks AlgorithmCache item as invalid
type FailedPredicateMap ¶
type FailedPredicateMap map[string][]algorithm.PredicateFailureReason
type FitError ¶
type FitError struct { Pod *v1.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 *v1.Pod, nodes []*v1.Node, nodeNameToInfo map[string]*schedulercache.NodeInfo) ([]*v1.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 *v1.Pod, nodes []*v1.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 HostPredicate ¶
type HostPredicate struct { Fit bool FailReasons []algorithm.PredicateFailureReason }