kubernetesk8s.io/kubernetes/plugin/pkg/scheduler/factory Index | Files

package factory

import "k8s.io/kubernetes/plugin/pkg/scheduler/factory"

Package factory can set up a scheduler. This code is here instead of plugin/cmd/scheduler for both testability and reuse.

Index

Constants

const (
	DefaultProvider = "default"
)

Variables

var (
	PodLister    = &storeToPodLister{cache.NewStore()}
	MinionLister = &storeToNodeLister{cache.NewStore()}
)

Functions

func IsFitPredicateRegistered

func IsFitPredicateRegistered(key string) bool

IsFitPredicateRegistered check is useful for testing providers.

func IsPriorityFunctionRegistered

func IsPriorityFunctionRegistered(key string) bool

IsPriorityFunctionRegistered check is useful for testing providers.

func RegisterAlgorithmProvider

func RegisterAlgorithmProvider(name string, predicateKeys, priorityKeys util.StringSet) string

RegisterAlgorithmProvider registers a new algorithm provider with the algorithm registry. This should be called from the init function in a provider plugin.

func RegisterFitPredicate

func RegisterFitPredicate(key string, predicate algorithm.FitPredicate) string

RegisterFitPredicate registers a fit predicate with the algorithm registry. Returns the key, with which the predicate was registered.

func RegisterPriorityFunction

func RegisterPriorityFunction(key string, function algorithm.PriorityFunction, weight int) string

RegisterFitPredicate registers a priority function with the algorithm registry. Returns the key, with which the function was registered.

func SetPriorityFunctionWeight

func SetPriorityFunctionWeight(key string, weight int)

SetPriorityFunctionWeight sets the weight of an already registered priority function.

Types

type AlgorithmProviderConfig

type AlgorithmProviderConfig struct {
	FitPredicateKeys     util.StringSet
	PriorityFunctionKeys util.StringSet
}

func GetAlgorithmProvider

func GetAlgorithmProvider(name string) (*AlgorithmProviderConfig, error)

GetAlgorithmProvider should not be used to modify providers. It is publicly visible for testing.

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
}

ConfigFactory knows how to fill out a scheduler config with its support functions.

func NewConfigFactory

func NewConfigFactory(client *client.Client) *ConfigFactory

NewConfigFactory initializes the factory.

func (*ConfigFactory) Create

func (f *ConfigFactory) Create() (*scheduler.Config, error)

Create creates a scheduler with the default algorithm provider.

func (*ConfigFactory) CreateFromKeys

func (f *ConfigFactory) CreateFromKeys(predicateKeys, priorityKeys util.StringSet) (*scheduler.Config, error)

CreateFromKeys creates a scheduler from a set of registered fit predicate keys and priority keys.

func (*ConfigFactory) CreateFromProvider

func (f *ConfigFactory) CreateFromProvider(providerName string) (*scheduler.Config, error)

CreateFromProvider creates a scheduler from the name of a registered algorithm provider.

Source Files

factory.go plugins.go

Version
v0.8.2
Published
Jan 20, 2015
Platform
js/wasm
Imports
14 packages
Last checked
12 minutes ago

Tools for package owners.