Documentation
¶
Overview ¶
Package scheduler contains a generic Scheduler interface and several implementations.
Index ¶
- func EmptyMetadataProducer(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo) interface{}
- type ControllerLister
- type EmptyControllerLister
- type EmptyReplicaSetLister
- type FakeControllerLister
- type FakeNodeLister
- type FakePodLister
- type FakeReplicaSetLister
- type FakeServiceLister
- type FitPredicate
- type GetEquivalencePodFunc
- type MetadataProducer
- type NodeLister
- type PodLister
- type PredicateFailureReason
- type PriorityConfig
- type PriorityFunction
- type PriorityMapFunction
- type PriorityReduceFunction
- type ReplicaSetLister
- type ScheduleAlgorithm
- type SchedulerExtender
- type ServiceLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EmptyMetadataProducer ¶ added in v1.5.1
func EmptyMetadataProducer(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo) interface{}
EmptyMetadataProducer returns a no-op MetadataProducer type.
Types ¶
type ControllerLister ¶ added in v1.2.3
type ControllerLister interface { // Lists all the replication controllers List(labels.Selector) ([]*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.2.3
type EmptyControllerLister struct{}
EmptyControllerLister implements ControllerLister on []api.ReplicationController returning empty data
func (EmptyControllerLister) GetPodControllers ¶ added in v1.2.3
func (f EmptyControllerLister) GetPodControllers(pod *api.Pod) (controllers []*api.ReplicationController, err error)
GetPodControllers returns nil
func (EmptyControllerLister) List ¶ added in v1.2.3
func (f EmptyControllerLister) List(labels.Selector) ([]*api.ReplicationController, error)
List returns nil
type EmptyReplicaSetLister ¶ added in v1.2.3
type EmptyReplicaSetLister struct{}
EmptyReplicaSetLister implements ReplicaSetLister on []extensions.ReplicaSet returning empty data
func (EmptyReplicaSetLister) GetPodReplicaSets ¶ added in v1.2.3
func (f EmptyReplicaSetLister) GetPodReplicaSets(pod *api.Pod) (rss []*extensions.ReplicaSet, err error)
GetPodReplicaSets returns nil
type FakeControllerLister ¶ added in v1.2.3
type FakeControllerLister []*api.ReplicationController
FakeControllerLister implements ControllerLister on []api.ReplicationController for test purposes.
func (FakeControllerLister) GetPodControllers ¶ added in v1.2.3
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.2.3
func (f FakeControllerLister) List(labels.Selector) ([]*api.ReplicationController, error)
List returns []api.ReplicationController, the list of all ReplicationControllers.
type FakeNodeLister ¶ added in v1.2.3
FakeNodeLister implements NodeLister on a []string for test purposes.
type FakePodLister ¶
FakePodLister implements PodLister on an []api.Pods for test purposes.
type FakeReplicaSetLister ¶ added in v1.2.3
type FakeReplicaSetLister []*extensions.ReplicaSet
FakeReplicaSetLister implements ControllerLister on []extensions.ReplicaSet for test purposes.
func (FakeReplicaSetLister) GetPodReplicaSets ¶ added in v1.2.3
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
type FakeServiceLister ¶
FakeServiceLister implements ServiceLister on []api.Service for test purposes.
func (FakeServiceLister) GetPodServices ¶
GetPodServices gets the services that have the selector that match the labels on the given pod.
type FitPredicate ¶
type FitPredicate func(pod *api.Pod, meta interface{}, nodeInfo *schedulercache.NodeInfo) (bool, []PredicateFailureReason, error)
FitPredicate is a function that indicates if a pod fits into an existing node. The failure information is given by the error. TODO: Change interface{} to a specific type.
type GetEquivalencePodFunc ¶ added in v1.5.1
type MetadataProducer ¶ added in v1.5.1
type MetadataProducer func(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo) interface{}
MetdataProducer is a function that computes metadata for a given pod.
type NodeLister ¶ added in v1.2.3
type NodeLister interface { // We explicitly return []*api.Node, instead of api.NodeList, to avoid // performing expensive copies that are unneded. List() ([]*api.Node, error) }
NodeLister interface represents anything that can list nodes for a scheduler.
type PodLister ¶
type PodLister interface { // We explicitly return []*api.Pod, instead of api.PodList, to avoid // performing expensive copies that are unneded. List(labels.Selector) ([]*api.Pod, error) }
PodLister interface represents anything that can list pods for a scheduler.
type PredicateFailureReason ¶ added in v1.4.2
type PredicateFailureReason interface {
GetReason() string
}
type PriorityConfig ¶
type PriorityConfig struct { Map PriorityMapFunction Reduce PriorityReduceFunction // TODO: Remove it after migrating all functions to // Map-Reduce pattern. Function PriorityFunction Weight int }
type PriorityFunction ¶
type PriorityFunction func(pod *api.Pod, nodeNameToInfo map[string]*schedulercache.NodeInfo, nodes []*api.Node) (schedulerapi.HostPriorityList, error)
DEPRECATED Use Map-Reduce pattern for priority functions.
type PriorityMapFunction ¶ added in v1.5.1
type PriorityMapFunction func(pod *api.Pod, meta interface{}, nodeInfo *schedulercache.NodeInfo) (schedulerapi.HostPriority, error)
PriorityMapFunction is a function that computes per-node results for a given node. TODO: Figure out the exact API of this method. TODO: Change interface{} to a specific type.
type PriorityReduceFunction ¶ added in v1.5.1
type PriorityReduceFunction func(pod *api.Pod, meta interface{}, nodeNameToInfo map[string]*schedulercache.NodeInfo, result schedulerapi.HostPriorityList) error
PriorityReduceFunction is a function that aggregated per-node results and computes final scores for all nodes. TODO: Figure out the exact API of this method. TODO: Change interface{} to a specific type.
type ReplicaSetLister ¶ added in v1.2.3
type ReplicaSetLister interface { // 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 ¶
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 ¶ added in v1.2.3
type SchedulerExtender interface { // Filter based on extender-implemented predicate functions. The filtered list is // expected to be a subset of the supplied list. failedNodesMap optionally contains // the list of failed nodes and failure reasons. Filter(pod *api.Pod, nodes []*api.Node) (filteredNodes []*api.Node, failedNodesMap schedulerapi.FailedNodesMap, 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.Node) (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 ¶
type ServiceLister interface { // Lists all the services List(labels.Selector) ([]*api.Service, 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.