kubernetes: github.com/harboe/kubernetes/plugin/pkg/scheduler/algorithm Index | Files | Directories

package algorithm

import "github.com/harboe/kubernetes/plugin/pkg/scheduler/algorithm"

Package scheduler contains a generic Scheduler interface and several implementations.

Index

Package Files

doc.go listers.go scheduler_interface.go types.go

type ControllerLister Uses

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 Uses

type EmptyControllerLister struct{}

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

func (EmptyControllerLister) GetPodControllers Uses

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

GetPodControllers returns nil

func (EmptyControllerLister) List Uses

func (f EmptyControllerLister) List() ([]api.ReplicationController, error)

List returns nil

type EmptyReplicaSetLister Uses

type EmptyReplicaSetLister struct{}

EmptyReplicaSetLister implements ReplicaSetLister on []extensions.ReplicaSet returning empty data

func (EmptyReplicaSetLister) GetPodReplicaSets Uses

func (f EmptyReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error)

GetPodReplicaSets returns nil

func (EmptyReplicaSetLister) List Uses

func (f EmptyReplicaSetLister) List() ([]extensions.ReplicaSet, error)

List returns nil

type FakeControllerLister Uses

type FakeControllerLister []api.ReplicationController

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

func (FakeControllerLister) GetPodControllers Uses

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 Uses

func (f FakeControllerLister) List() ([]api.ReplicationController, error)

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

type FakeNodeLister Uses

type FakeNodeLister api.NodeList

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

func (FakeNodeLister) List Uses

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

List returns nodes as a []string.

type FakePodLister Uses

type FakePodLister []*api.Pod

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

func (FakePodLister) List Uses

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

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

type FakeReplicaSetLister Uses

type FakeReplicaSetLister []extensions.ReplicaSet

FakeReplicaSetLister implements ControllerLister on []extensions.ReplicaSet for test purposes.

func (FakeReplicaSetLister) GetPodReplicaSets Uses

func (f FakeReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []extensions.ReplicaSet, err error)

GetPodReplicaSets gets the ReplicaSets that have the selector that match the labels on the given pod

func (FakeReplicaSetLister) List Uses

func (f FakeReplicaSetLister) List() ([]extensions.ReplicaSet, error)

List returns []extensions.ReplicaSet, the list of all ReplicaSets.

type FakeServiceLister Uses

type FakeServiceLister []api.Service

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

func (FakeServiceLister) GetPodServices Uses

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 Uses

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

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

type FitPredicate Uses

type FitPredicate func(pod *api.Pod, nodeName string, nodeInfo *schedulercache.NodeInfo) (bool, error)

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

type NodeLister Uses

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

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

type PodLister Uses

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 Uses

type PriorityConfig struct {
    Function PriorityFunction
    Weight   int
}

type PriorityFunction Uses

type PriorityFunction func(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodeLister NodeLister) (schedulerapi.HostPriorityList, error)

type ReplicaSetLister Uses

type ReplicaSetLister interface {
    // Lists all the replicasets
    List() ([]extensions.ReplicaSet, error)
    // Gets the replicasets for the given pod
    GetPodReplicaSets(*api.Pod) ([]extensions.ReplicaSet, error)
}

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

type ScheduleAlgorithm Uses

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

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

type SchedulerExtender Uses

type SchedulerExtender interface {
    // Filter based on extender-implemented predicate functions. The filtered list is
    // expected to be a subset of the supplied list.
    Filter(pod *api.Pod, nodes *api.NodeList) (filteredNodes *api.NodeList, err error)

    // Prioritize based on extender-implemented priority functions. The returned scores & weight
    // are used to compute the weighted score for an extender. The weighted scores are added to
    // the scores computed  by Kubernetes scheduler. The total scores are used to do the host selection.
    Prioritize(pod *api.Pod, nodes *api.NodeList) (hostPriorities *schedulerapi.HostPriorityList, weight int, err error)
}

SchedulerExtender is an interface for external processes to influence scheduling decisions made by Kubernetes. This is typically needed for resources not directly managed by Kubernetes.

type ServiceLister Uses

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

PathSynopsis
predicates
priorities
priorities/util

Package algorithm imports 7 packages (graph). Updated 2018-04-30. Refresh now. Tools for package owners.