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

package scheduler

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

Index

Package Files

eventhandlers.go scheduler.go testutil.go

Constants

const (
    // BindTimeoutSeconds defines the default bind timeout
    BindTimeoutSeconds = 100
    // SchedulerError is the reason recorded for events when an error occurs during scheduling a pod.
    SchedulerError = "SchedulerError"
)

Variables

var EmptyPluginRegistry = framework.Registry{}

EmptyPluginRegistry is an empty plugin registry used in tests.

func AddAllEventHandlers Uses

func AddAllEventHandlers(
    sched *Scheduler,
    schedulerName string,
    nodeInformer coreinformers.NodeInformer,
    podInformer coreinformers.PodInformer,
    pvInformer coreinformers.PersistentVolumeInformer,
    pvcInformer coreinformers.PersistentVolumeClaimInformer,
    serviceInformer coreinformers.ServiceInformer,
    storageClassInformer storageinformersv1.StorageClassInformer,
    csiNodeInformer storageinformersv1beta1.CSINodeInformer,
)

AddAllEventHandlers is a helper function used in tests and in Scheduler to add event handlers for various informers.

type FakeConfigurator Uses

type FakeConfigurator struct {
    Config *factory.Config
}

FakeConfigurator is an implementation for test.

func (*FakeConfigurator) Create Uses

func (fc *FakeConfigurator) Create() (*factory.Config, error)

Create returns FakeConfigurator.Config

func (*FakeConfigurator) CreateFromConfig Uses

func (fc *FakeConfigurator) CreateFromConfig(policy schedulerapi.Policy) (*factory.Config, error)

CreateFromConfig returns FakeConfigurator.Config

func (*FakeConfigurator) CreateFromKeys Uses

func (fc *FakeConfigurator) CreateFromKeys(predicateKeys, priorityKeys sets.String, extenders []algorithm.SchedulerExtender) (*factory.Config, error)

CreateFromKeys returns FakeConfigurator.Config

func (*FakeConfigurator) CreateFromProvider Uses

func (fc *FakeConfigurator) CreateFromProvider(providerName string) (*factory.Config, error)

CreateFromProvider returns FakeConfigurator.Config

func (*FakeConfigurator) GetClient Uses

func (fc *FakeConfigurator) GetClient() clientset.Interface

GetClient is not implemented yet.

func (*FakeConfigurator) GetHardPodAffinitySymmetricWeight Uses

func (fc *FakeConfigurator) GetHardPodAffinitySymmetricWeight() int32

GetHardPodAffinitySymmetricWeight is not implemented yet.

func (*FakeConfigurator) GetNodeLister Uses

func (fc *FakeConfigurator) GetNodeLister() corelisters.NodeLister

GetNodeLister is not implemented yet.

func (*FakeConfigurator) GetPredicateMetadataProducer Uses

func (fc *FakeConfigurator) GetPredicateMetadataProducer() (predicates.PredicateMetadataProducer, error)

GetPredicateMetadataProducer is not implemented yet.

func (*FakeConfigurator) GetPredicates Uses

func (fc *FakeConfigurator) GetPredicates(predicateKeys sets.String) (map[string]predicates.FitPredicate, error)

GetPredicates is not implemented yet.

func (*FakeConfigurator) GetScheduledPodLister Uses

func (fc *FakeConfigurator) GetScheduledPodLister() corelisters.PodLister

GetScheduledPodLister is not implemented yet.

func (*FakeConfigurator) MakeDefaultErrorFunc Uses

func (fc *FakeConfigurator) MakeDefaultErrorFunc(backoff *internalqueue.PodBackoffMap, podQueue internalqueue.SchedulingQueue) func(pod *v1.Pod, err error)

MakeDefaultErrorFunc is not implemented yet.

type Option Uses

type Option func(*schedulerOptions)

Option configures a Scheduler

func WithBindTimeoutSeconds Uses

func WithBindTimeoutSeconds(bindTimeoutSeconds int64) Option

WithBindTimeoutSeconds sets bindTimeoutSeconds for Scheduler, the default value is 100

func WithHardPodAffinitySymmetricWeight Uses

func WithHardPodAffinitySymmetricWeight(hardPodAffinitySymmetricWeight int32) Option

WithHardPodAffinitySymmetricWeight sets hardPodAffinitySymmetricWeight for Scheduler, the default value is 1

func WithName Uses

func WithName(schedulerName string) Option

WithName sets schedulerName for Scheduler, the default schedulerName is default-scheduler

func WithPercentageOfNodesToScore Uses

func WithPercentageOfNodesToScore(percentageOfNodesToScore int32) Option

WithPercentageOfNodesToScore sets percentageOfNodesToScore for Scheduler, the default value is 50

func WithPreemptionDisabled Uses

func WithPreemptionDisabled(disablePreemption bool) Option

WithPreemptionDisabled sets disablePreemption for Scheduler, the default value is false

type Scheduler Uses

type Scheduler struct {
    // contains filtered or unexported fields
}

Scheduler watches for new unscheduled pods. It attempts to find nodes that they fit on and writes bindings back to the api server.

func New Uses

func New(client clientset.Interface,
    nodeInformer coreinformers.NodeInformer,
    podInformer coreinformers.PodInformer,
    pvInformer coreinformers.PersistentVolumeInformer,
    pvcInformer coreinformers.PersistentVolumeClaimInformer,
    replicationControllerInformer coreinformers.ReplicationControllerInformer,
    replicaSetInformer appsinformers.ReplicaSetInformer,
    statefulSetInformer appsinformers.StatefulSetInformer,
    serviceInformer coreinformers.ServiceInformer,
    pdbInformer policyinformers.PodDisruptionBudgetInformer,
    storageClassInformer storageinformersv1.StorageClassInformer,
    csiNodeInformer storageinformersv1beta1.CSINodeInformer,
    recorder events.EventRecorder,
    schedulerAlgorithmSource kubeschedulerconfig.SchedulerAlgorithmSource,
    stopCh <-chan struct{},
    registry framework.Registry,
    plugins *kubeschedulerconfig.Plugins,
    pluginConfig []kubeschedulerconfig.PluginConfig,
    opts ...func(o *schedulerOptions)) (*Scheduler, error)

New returns a Scheduler

func NewFromConfig Uses

func NewFromConfig(config *factory.Config) *Scheduler

NewFromConfig returns a new scheduler using the provided Config.

func (*Scheduler) Cache Uses

func (sched *Scheduler) Cache() internalcache.Cache

Cache returns the cache in scheduler for test to check the data in scheduler.

func (*Scheduler) Config Uses

func (sched *Scheduler) Config() *factory.Config

Config returns scheduler's config pointer. It is exposed for testing purposes.

func (*Scheduler) Run Uses

func (sched *Scheduler) Run()

Run begins watching and scheduling. It waits for cache to be synced, then starts a goroutine and returns immediately.

Directories

PathSynopsis
algorithmPackage algorithm contains a generic Scheduler interface and several implementations.
algorithm/predicates
algorithm/priorities
algorithm/priorities/util
algorithmprovider
algorithmprovider/defaults
apiPackage api contains scheduler API objects.
api/latest
apis/config
apis/config/scheme
apis/config/v1alpha1
apis/config/validation
api/v1Package v1 contains scheduler API objects.
api/validation
core
factoryPackage factory can set up a scheduler.
framework/v1alpha1
internal/cache
internal/cache/debugger
internal/cache/fake
internal/queue
metrics
nodeinfo
testing
util
volumebinder

Package scheduler imports 36 packages (graph) and is imported by 23 packages. Updated 2019-07-21. Refresh now. Tools for package owners.