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 FakeMinionLister ¶
type FakeMinionLister []string
FakeMinionLister implements MinionLister on a []string for test purposes.
func (FakeMinionLister) List ¶
func (f FakeMinionLister) List() ([]string, error)
List returns minions as a []string
type FakePodLister ¶
FakePodLister implements PodLister on an []api.Pods for test purposes.
type MinionLister ¶
MinionLister interface represents anything that can list minions for a scheduler.
type RandomFitScheduler ¶
type RandomFitScheduler struct {
// contains filtered or unexported fields
}
RandomFitScheduler is a Scheduler which schedules a Pod on a random machine which matches its requirement.
func (*RandomFitScheduler) Schedule ¶
func (s *RandomFitScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)
Schedule schedules a pod on a random machine which matches its requirement.
type RandomScheduler ¶
type RandomScheduler struct {
// contains filtered or unexported fields
}
RandomScheduler chooses machines uniformly at random.
func (*RandomScheduler) Schedule ¶
func (s *RandomScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)
Schedule schedules a given pod to a random machine.
type RoundRobinScheduler ¶
type RoundRobinScheduler struct {
// contains filtered or unexported fields
}
RoundRobinScheduler chooses machines in order.
func (*RoundRobinScheduler) Schedule ¶
func (s *RoundRobinScheduler) Schedule(pod api.Pod, minionLister MinionLister) (string, error)
Schedule schedules a pod on the machine next to the last scheduled machine.
type Scheduler ¶
type Scheduler interface {
Schedule(api.Pod, MinionLister) (selectedMachine string, err error)
}
Scheduler is an interface implemented by things that know how to schedule pods onto machines.
func MakeRandomScheduler ¶
func MakeRoundRobinScheduler ¶
func MakeRoundRobinScheduler() Scheduler