Documentation ¶
Index ¶
- Constants
- func AddAllEventHandlers(sched *Scheduler, schedulerName string, ...)
- type Option
- func WithBindTimeoutSeconds(bindTimeoutSeconds int64) Option
- func WithHardPodAffinitySymmetricWeight(hardPodAffinitySymmetricWeight int32) Option
- func WithName(schedulerName string) Option
- func WithPercentageOfNodesToScore(percentageOfNodesToScore int32) Option
- func WithPreemptionDisabled(disablePreemption bool) Option
- type Scheduler
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 ¶
This section is empty.
Functions ¶
func AddAllEventHandlers ¶ added in v1.14.0
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.
Types ¶
type Option ¶ added in v1.13.0
type Option func(*schedulerOptions)
Option configures a Scheduler
func WithBindTimeoutSeconds ¶ added in v1.13.0
WithBindTimeoutSeconds sets bindTimeoutSeconds for Scheduler, the default value is 100
func WithHardPodAffinitySymmetricWeight ¶ added in v1.13.0
WithHardPodAffinitySymmetricWeight sets hardPodAffinitySymmetricWeight for Scheduler, the default value is 1
func WithName ¶ added in v1.13.0
WithName sets schedulerName for Scheduler, the default schedulerName is default-scheduler
func WithPercentageOfNodesToScore ¶ added in v1.13.0
WithPercentageOfNodesToScore sets percentageOfNodesToScore for Scheduler, the default value is 50
func WithPreemptionDisabled ¶ added in v1.13.0
WithPreemptionDisabled sets disablePreemption for Scheduler, the default value is false
type Scheduler ¶
type Scheduler struct { // It is expected that changes made via SchedulerCache will be observed // by NodeLister and Algorithm. SchedulerCache internalcache.Cache Algorithm core.ScheduleAlgorithm GetBinder func(pod *v1.Pod) factory.Binder // PodConditionUpdater is used only in case of scheduling errors. If we succeed // with scheduling, PodScheduled condition will be updated in apiserver in /bind // handler so that binding and setting PodCondition it is atomic. PodConditionUpdater factory.PodConditionUpdater // PodPreemptor is used to evict pods and update 'NominatedNode' field of // the preemptor pod. PodPreemptor factory.PodPreemptor // 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() *v1.Pod // WaitForCacheSync waits for scheduler cache to populate. // It returns true if it was successful, false if the controller should shutdown. WaitForCacheSync func() bool // Error is called if there is an error. It is passed the pod in // question, and the error Error func(*v1.Pod, 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 }
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 ¶ added in v1.13.0
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 ¶ added in v1.10.0
NewFromConfig returns a new scheduler using the provided Config.
func (*Scheduler) Cache ¶ added in v1.12.0
func (sched *Scheduler) Cache() internalcache.Cache
Cache returns the cache in scheduler for test to check the data in scheduler.
Directories ¶
Path | Synopsis |
---|---|
Package algorithm contains a generic Scheduler interface and several implementations.
|
Package algorithm contains a generic Scheduler interface and several implementations. |
Package api contains scheduler API objects.
|
Package api contains scheduler API objects. |
v1
Package v1 contains scheduler API objects.
|
Package v1 contains scheduler API objects. |
apis
|
|
Package factory can set up a scheduler.
|
Package factory can set up a scheduler. |
framework
|
|
internal
|
|