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

package scheduler

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

Index

Package Files

eventhandlers.go factory.go scheduler.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"
)

func AddAllEventHandlers Uses

func AddAllEventHandlers(
    sched *Scheduler,
    schedulerName string,
    informerFactory informers.SharedInformerFactory,
    podInformer coreinformers.PodInformer,
)

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

func GetPodDisruptionBudgetLister Uses

func GetPodDisruptionBudgetLister(informerFactory informers.SharedInformerFactory) policylisters.PodDisruptionBudgetLister

GetPodDisruptionBudgetLister returns pdb lister from the given informer factory. Returns nil if PodDisruptionBudget feature is disabled.

func MakeDefaultErrorFunc Uses

func MakeDefaultErrorFunc(client clientset.Interface, podQueue internalqueue.SchedulingQueue, schedulerCache internalcache.Cache) func(*framework.PodInfo, error)

MakeDefaultErrorFunc construct a function to handle pod scheduler error

func NewPodInformer Uses

func NewPodInformer(client clientset.Interface, resyncPeriod time.Duration) coreinformers.PodInformer

NewPodInformer creates a shared index informer that returns only non-terminal pods.

type Binder Uses

type Binder interface {
    Bind(binding *v1.Binding) error
}

Binder knows how to write a binding.

type Configurator Uses

type Configurator struct {

    // Close this to stop all reflectors
    StopEverything <-chan struct{}
    // contains filtered or unexported fields
}

Configurator defines I/O, caching, and other functionality needed to construct a new scheduler.

type Option Uses

type Option func(*schedulerOptions)

Option configures a Scheduler

func WithAlgorithmSource Uses

func WithAlgorithmSource(source schedulerapi.SchedulerAlgorithmSource) Option

WithAlgorithmSource sets schedulerAlgorithmSource for Scheduler, the default is a source with DefaultProvider.

func WithBindTimeoutSeconds Uses

func WithBindTimeoutSeconds(bindTimeoutSeconds int64) Option

WithBindTimeoutSeconds sets bindTimeoutSeconds for Scheduler, the default value is 100

func WithFrameworkOutOfTreeRegistry Uses

func WithFrameworkOutOfTreeRegistry(registry framework.Registry) Option

WithFrameworkOutOfTreeRegistry sets the registry for out-of-tree plugins. Those plugins will be appended to the default registry.

func WithFrameworkPluginConfig Uses

func WithFrameworkPluginConfig(pluginConfig []schedulerapi.PluginConfig) Option

WithFrameworkPluginConfig sets the PluginConfig slice that the framework should be configured with.

func WithFrameworkPlugins Uses

func WithFrameworkPlugins(plugins *schedulerapi.Plugins) Option

WithFrameworkPlugins sets the plugins that the framework should be configured with.

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

func WithPodInitialBackoffSeconds(podInitialBackoffSeconds int64) Option

WithPodInitialBackoffSeconds sets podInitialBackoffSeconds for Scheduler, the default value is 1

func WithPodMaxBackoffSeconds Uses

func WithPodMaxBackoffSeconds(podMaxBackoffSeconds int64) Option

WithPodMaxBackoffSeconds sets podMaxBackoffSeconds for Scheduler, the default value is 10

func WithPreemptionDisabled Uses

func WithPreemptionDisabled(disablePreemption bool) Option

WithPreemptionDisabled sets disablePreemption for Scheduler, the default value is false

type Scheduler Uses

type Scheduler struct {
    // It is expected that changes made via SchedulerCache will be observed
    // by NodeLister and Algorithm.
    SchedulerCache internalcache.Cache

    Algorithm core.ScheduleAlgorithm

    // Framework runs scheduler plugins at configured extension points.
    Framework framework.Framework

    // NextPod should be a function that blocks until the next pod
    // is available. We don't use a channel for this, because scheduling
    // a pod may take some amount of time and we don't want pods to get
    // stale while they sit in a channel.
    NextPod func() *framework.PodInfo

    // Error is called if there is an error. It is passed the pod in
    // question, and the error
    Error func(*framework.PodInfo, error)

    // Recorder is the EventRecorder to use
    Recorder events.EventRecorder

    // Close this to shut down the scheduler.
    StopEverything <-chan struct{}

    // VolumeBinder handles PVC/PV binding for the pod.
    VolumeBinder *volumebinder.VolumeBinder

    // Disable pod preemption or not.
    DisablePreemption bool

    // SchedulingQueue holds pods to be scheduled
    SchedulingQueue internalqueue.SchedulingQueue
    // 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,
    informerFactory informers.SharedInformerFactory,
    podInformer coreinformers.PodInformer,
    recorder events.EventRecorder,
    stopCh <-chan struct{},
    opts ...Option) (*Scheduler, error)

New returns a Scheduler

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) Run Uses

func (sched *Scheduler) Run(ctx context.Context)

Run begins watching and scheduling. It waits for cache to be synced, then starts scheduling and blocked until the context is done.

Directories

PathSynopsis
algorithmprovider
api
apis/config
apis/config/scheme
apis/config/v1
apis/config/v1alpha1
apis/config/validation
apis/extender/v1Package v1 contains scheduler API objects.
core
framework/plugins
framework/plugins/defaultbinder
framework/plugins/defaultpodtopologyspread
framework/plugins/helper
framework/plugins/imagelocality
framework/plugins/interpodaffinity
framework/plugins/migration
framework/plugins/nodeaffinity
framework/plugins/nodelabel
framework/plugins/nodename
framework/plugins/nodeports
framework/plugins/nodepreferavoidpods
framework/plugins/noderesources
framework/plugins/nodeunschedulable
framework/plugins/nodevolumelimits
framework/plugins/podtopologyspread
framework/plugins/queuesort
framework/plugins/requestedtocapacityratio
framework/plugins/serviceaffinity
framework/plugins/tainttoleration
framework/plugins/volumebinding
framework/plugins/volumerestrictions
framework/plugins/volumezone
framework/v1alpha1
internal/cache
internal/cache/debugger
internal/cache/fake
internal/heap
internal/queue
listers
listers/fake
metrics
nodeinfo
nodeinfo/snapshot
testing
util
volumebinder

Package scheduler imports 45 packages (graph) and is imported by 47 packages. Updated 2020-01-27. Refresh now. Tools for package owners.