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

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

func NewConfigFactory(client *client.Client) *ConfigFactory

NewConfigFactory initializes the factory.

func (*ConfigFactory) AddPredicate

func (factory *ConfigFactory) AddPredicate(key string, function algorithm.FitPredicate)

func (*ConfigFactory) AddPriority

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

func (factory *ConfigFactory) SetWeight(key string, weight int)

Source Files

factory.go

Version
v0.7.3
Published
Jan 8, 2015
Platform
js/wasm
Imports
14 packages
Last checked
6 minutes ago

Tools for package owners.