kubernetes: k8s.io/kubernetes/pkg/scheduler/algorithm Index | Files | Directories

package algorithm

import "k8s.io/kubernetes/pkg/scheduler/algorithm"

Package algorithm contains a generic Scheduler interface and several implementations.

Index

Package Files

doc.go scheduler_interface.go types.go

Variables

var NodeFieldSelectorKeys = map[string]func(*v1.Node) string{
    api.ObjectNameField: func(n *v1.Node) string { return n.Name },
}

NodeFieldSelectorKeys is a map that: the keys are node field selector keys; the values are the functions to get the value of the node field.

type EmptyControllerLister Uses

type EmptyControllerLister struct{}

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

func (EmptyControllerLister) GetPodControllers Uses

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

GetPodControllers returns nil

func (EmptyControllerLister) List Uses

func (f EmptyControllerLister) List(labels.Selector) ([]*v1.ReplicationController, error)

List returns nil

func (EmptyControllerLister) ReplicationControllers Uses

func (f EmptyControllerLister) ReplicationControllers(namespace string) corelisters.ReplicationControllerNamespaceLister

ReplicationControllers 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 *v1.Pod) (rss []*appsv1.ReplicaSet, err error)

GetPodReplicaSets returns nil

func (EmptyReplicaSetLister) List Uses

func (f EmptyReplicaSetLister) List(labels.Selector) ([]*appsv1.ReplicaSet, error)

List returns nil

func (EmptyReplicaSetLister) ReplicaSets Uses

func (f EmptyReplicaSetLister) ReplicaSets(namespace string) appslisters.ReplicaSetNamespaceLister

ReplicaSets returns nil

type EmptyStatefulSetLister Uses

type EmptyStatefulSetLister struct{}

EmptyStatefulSetLister implements StatefulSetLister on []apps.StatefulSet returning empty data.

func (EmptyStatefulSetLister) GetPodStatefulSets Uses

func (f EmptyStatefulSetLister) GetPodStatefulSets(pod *v1.Pod) (sss []*appsv1.StatefulSet, err error)

GetPodStatefulSets of EmptyStatefulSetLister returns nil.

func (EmptyStatefulSetLister) List Uses

func (f EmptyStatefulSetLister) List(labels.Selector) ([]*appsv1.StatefulSet, error)

List returns nil

func (EmptyStatefulSetLister) StatefulSets Uses

func (f EmptyStatefulSetLister) StatefulSets(namespace string) appslisters.StatefulSetNamespaceLister

StatefulSets returns nil

type SchedulerExtender Uses

type SchedulerExtender interface {
    // Name returns a unique name that identifies the extender.
    Name() string

    // 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 *v1.Pod,
        nodes []*v1.Node, nodeNameToInfo map[string]*schedulernodeinfo.NodeInfo,
    ) (filteredNodes []*v1.Node, failedNodesMap extenderv1.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 *v1.Pod, nodes []*v1.Node) (hostPriorities *extenderv1.HostPriorityList, weight int64, err error)

    // Bind delegates the action of binding a pod to a node to the extender.
    Bind(binding *v1.Binding) error

    // IsBinder returns whether this extender is configured for the Bind method.
    IsBinder() bool

    // IsInterested returns true if at least one extended resource requested by
    // this pod is managed by this extender.
    IsInterested(pod *v1.Pod) bool

    // ProcessPreemption returns nodes with their victim pods processed by extender based on
    // given:
    //   1. Pod to schedule
    //   2. Candidate nodes and victim pods (nodeToVictims) generated by previous scheduling process.
    //   3. nodeNameToInfo to restore v1.Node from node name if extender cache is enabled.
    // The possible changes made by extender may include:
    //   1. Subset of given candidate nodes after preemption phase of extender.
    //   2. A different set of victim pod for every given candidate node after preemption phase of extender.
    ProcessPreemption(
        pod *v1.Pod,
        nodeToVictims map[*v1.Node]*extenderv1.Victims,
        nodeNameToInfo map[string]*schedulernodeinfo.NodeInfo,
    ) (map[*v1.Node]*extenderv1.Victims, error)

    // SupportsPreemption returns if the scheduler extender support preemption or not.
    SupportsPreemption() bool

    // IsIgnorable returns true indicates scheduling should not fail when this extender
    // is unavailable. This gives scheduler ability to fail fast and tolerate non-critical extenders as well.
    IsIgnorable() bool
}

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 StatefulSetLister Uses

type StatefulSetLister interface {
    // Gets the StatefulSet for the given pod.
    GetPodStatefulSets(*v1.Pod) ([]*apps.StatefulSet, error)
}

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

Directories

PathSynopsis
predicates
priorities
priorities/util

Package algorithm imports 9 packages (graph) and is imported by 227 packages. Updated 2019-12-10. Refresh now. Tools for package owners.