Documentation ¶
Overview ¶
Package factory can set up a scheduler. This code is here instead of plugin/cmd/scheduler for both testability and reuse.
Index ¶
- type ConfigFactory
- func (factory *ConfigFactory) AddPredicate(key string, function algorithm.FitPredicate)
- func (factory *ConfigFactory) AddPriority(key string, function algorithm.PriorityFunction, weight int)
- func (factory *ConfigFactory) Create(predicateKeys, priorityKeys []string) (*scheduler.Config, error)
- func (factory *ConfigFactory) SetWeight(key string, weight int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigFactory ¶
type ConfigFactory struct { Client *client.Client // queue for pods that need scheduling PodQueue *cache.FIFO // a means to list all scheduled pods PodLister *storeToPodLister // a means to list all minions MinionLister *storeToNodeLister // map of strings to predicate functions to be used // to filter the minions for scheduling pods PredicateMap map[string]algorithm.FitPredicate // map of strings to priority config to be used // to prioritize the filtered minions for scheduling pods PriorityMap map[string]algorithm.PriorityConfig }
ConfigFactory knows how to fill out a scheduler config with its support functions.
func NewConfigFactory ¶ added in v0.7.0
func NewConfigFactory(client *client.Client) *ConfigFactory
NewConfigFactory initializes the factory.
func (*ConfigFactory) AddPredicate ¶ added in v0.7.0
func (factory *ConfigFactory) AddPredicate(key string, function algorithm.FitPredicate)
func (*ConfigFactory) AddPriority ¶ added in v0.7.0
func (factory *ConfigFactory) AddPriority(key string, function algorithm.PriorityFunction, weight int)
func (*ConfigFactory) Create ¶
func (factory *ConfigFactory) Create(predicateKeys, priorityKeys []string) (*scheduler.Config, error)
Create creates a scheduler and all support functions.
func (*ConfigFactory) SetWeight ¶ added in v0.7.0
func (factory *ConfigFactory) SetWeight(key string, weight int)
Click to show internal directories.
Click to hide internal directories.