algorithm

package
v1.1.6-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package scheduler contains a generic Scheduler interface and several implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerLister added in v1.1.1

type ControllerLister interface {
	// Lists all the replication controllers
	List() ([]api.ReplicationController, error)
	// Gets the services for the given pod
	GetPodControllers(*api.Pod) ([]api.ReplicationController, error)
}

ControllerLister interface represents anything that can produce a list of ReplicationController; the list is consumed by a scheduler.

type EmptyControllerLister added in v1.1.1

type EmptyControllerLister struct{}

EmptyControllerLister implements ControllerLister on []api.ReplicationController returning empty data

func (EmptyControllerLister) GetPodControllers added in v1.1.1

func (f EmptyControllerLister) GetPodControllers(pod *api.Pod) (controllers []api.ReplicationController, err error)

GetPodControllers returns nil

func (EmptyControllerLister) List added in v1.1.1

List returns nil

type FakeControllerLister added in v1.1.1

type FakeControllerLister []api.ReplicationController

FakeControllerLister implements ControllerLister on []api.ReplicationController for test purposes.

func (FakeControllerLister) GetPodControllers added in v1.1.1

func (f FakeControllerLister) GetPodControllers(pod *api.Pod) (controllers []api.ReplicationController, err error)

GetPodControllers gets the ReplicationControllers that have the selector that match the labels on the given pod

func (FakeControllerLister) List added in v1.1.1

List returns []api.ReplicationController, the list of all ReplicationControllers.

type FakeNodeLister added in v1.1.1

type FakeNodeLister api.NodeList

FakeNodeLister implements NodeLister on a []string for test purposes.

func (FakeNodeLister) List added in v1.1.1

func (f FakeNodeLister) List() (api.NodeList, error)

List returns nodes as a []string.

type FakePodLister

type FakePodLister []*api.Pod

FakePodLister implements PodLister on an []api.Pods for test purposes.

func (FakePodLister) List

func (f FakePodLister) List(s labels.Selector) (selected []*api.Pod, err error)

List returns []*api.Pod matching a query.

type FakeServiceLister

type FakeServiceLister []api.Service

FakeServiceLister implements ServiceLister on []api.Service for test purposes.

func (FakeServiceLister) GetPodServices

func (f FakeServiceLister) GetPodServices(pod *api.Pod) (services []api.Service, err error)

GetPodServices gets the services that have the selector that match the labels on the given pod

func (FakeServiceLister) List

func (f FakeServiceLister) List() (api.ServiceList, error)

List returns api.ServiceList, the list of all services.

type FitPredicate

type FitPredicate func(pod *api.Pod, existingPods []*api.Pod, node string) (bool, error)

FitPredicate is a function that indicates if a pod fits into an existing node.

type HostPriority

type HostPriority struct {
	Host  string
	Score int
}

HostPriority represents the priority of scheduling to a particular host, lower priority is better.

type HostPriorityList

type HostPriorityList []HostPriority

func (HostPriorityList) Len

func (h HostPriorityList) Len() int

func (HostPriorityList) Less

func (h HostPriorityList) Less(i, j int) bool

func (HostPriorityList) Swap

func (h HostPriorityList) Swap(i, j int)

type NodeLister added in v1.1.1

type NodeLister interface {
	List() (list api.NodeList, err error)
}

NodeLister interface represents anything that can list nodes for a scheduler.

type PodLister

type PodLister interface {
	// TODO: make this exactly the same as client's Pods(ns).List() method, by returning a api.PodList
	List(labels.Selector) ([]*api.Pod, error)
}

PodLister interface represents anything that can list pods for a scheduler.

type PriorityConfig

type PriorityConfig struct {
	Function PriorityFunction
	Weight   int
}

type PriorityFunction

type PriorityFunction func(pod *api.Pod, podLister PodLister, nodeLister NodeLister) (HostPriorityList, error)

type ScheduleAlgorithm

type ScheduleAlgorithm interface {
	Schedule(*api.Pod, NodeLister) (selectedMachine string, err error)
}

Scheduler is an interface implemented by things that know how to schedule pods onto machines.

type ServiceLister

type ServiceLister interface {
	// Lists all the services
	List() (api.ServiceList, error)
	// Gets the services for the given pod
	GetPodServices(*api.Pod) ([]api.Service, error)
}

ServiceLister interface represents anything that can produce a list of services; the list is consumed by a scheduler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL