Documentation ¶
Index ¶
- Constants
- Variables
- func BindPhase(ctx context.Context, handler handle.BinderFrameworkHandle, ...) *framework.Status
- func CheckConflictPhase(ctx context.Context, rui *runningUnitInfo, nInfo framework.NodeInfo) *framework.Status
- func CheckPreemptionPhase(ctx context.Context, rui *runningUnitInfo, commonState *framework.CycleState) (returnStatus *framework.Status)
- func CheckTopologyPhase(ctx context.Context, rui *runningUnitInfo, commonState *framework.CycleState, ...) *framework.Status
- func DefaultQueueSortFunc() framework.LessFunc
- func DefaultUnitQueueSortFunc() framework.UnitLessFunc
- func IsPreemptionComplete(podLister corelisters.PodLister, victimPods framework.VictimPods) bool
- func MakeDefaultErrorFunc(client clientset.Interface, podLister corelisters.PodLister, ...) func(*framework.QueuedPodInfo, error)
- func NewBasePlugins(victimsCheckingPlugins []*framework.VictimCheckingPluginCollectionSpec) *apis.BinderPluginCollection
- func NewBindingUnitInfo(unit *framework.QueuedUnitInfo) *bindingUnitInfo
- func NewFrameworkHandle(client clientset.Interface, crdClient godelclient.Interface, ...) handle.BinderFrameworkHandle
- func ValidateUnit(unit *framework.QueuedUnitInfo) error
- type APICallFailedTask
- type Binder
- func (binder *Binder) CheckAndBindUnit(ctx context.Context) bool
- func (binder *Binder) CheckCrossNodePreemptionForUnit(ctx context.Context, unitInfo *bindingUnitInfo) error
- func (binder *Binder) CheckCrossNodeTopologyForUnit(ctx context.Context, unitInfo *bindingUnitInfo) error
- func (binder *Binder) CheckSameNodeConflictsForUnit(ctx context.Context, unitInfo *bindingUnitInfo) error
- func (binder *Binder) DeleteVictimsAndBindTasks(ctx context.Context, unitInfo *bindingUnitInfo) error
- func (binder *Binder) FailAndRejectAllTasks(unitInfo *bindingUnitInfo, err error)
- func (binder *Binder) InitializeUnit(unit *framework.QueuedUnitInfo) *bindingUnitInfo
- func (binder *Binder) MarkVictimsAndAssumeTasks(ctx context.Context, unitInfo *bindingUnitInfo) error
- func (binder *Binder) ReEnqueueWaitingTasks(unitInfo *bindingUnitInfo)
- func (binder *Binder) RejectFailedTasks(unitInfo *bindingUnitInfo)
- func (binder *Binder) RejectTimeOutUnit(unit *framework.QueuedUnitInfo)
- func (binder *Binder) Run(ctx context.Context)
- func (binder *Binder) UnitTimeout(unit *framework.QueuedUnitInfo) bool
- type BinderTasksReconciler
- type FailedReason
- type Option
- type TaskSetGroupByNode
Constants ¶
const ( MaxPreemptionBackoffPeriodInSeconds = 600 MaxRetryAttempts = 3 // TODO: 5 will cause a timeout in UT (30s) )
Variables ¶
var ErrNoNodesAvailable = fmt.Errorf("no nodes available to schedule pods")
ErrNoNodesAvailable is used to describe the error that no nodes available to schedule pods.
Functions ¶
func CheckConflictPhase ¶
func CheckPreemptionPhase ¶
func CheckPreemptionPhase( ctx context.Context, rui *runningUnitInfo, commonState *framework.CycleState, ) (returnStatus *framework.Status)
TODO: re-implement...
func CheckTopologyPhase ¶
func DefaultQueueSortFunc ¶
DefaultQueueSortFunc returns the function to sort pods in scheduling queue
func DefaultUnitQueueSortFunc ¶
func DefaultUnitQueueSortFunc() framework.UnitLessFunc
func IsPreemptionComplete ¶
func IsPreemptionComplete(podLister corelisters.PodLister, victimPods framework.VictimPods) bool
func MakeDefaultErrorFunc ¶
func MakeDefaultErrorFunc(client clientset.Interface, podLister corelisters.PodLister, podQueue queue.BinderQueue, binderCache godelcache.BinderCache) func(*framework.QueuedPodInfo, error)
MakeDefaultErrorFunc construct a function to handle pod scheduler error
func NewBasePlugins ¶
func NewBasePlugins(victimsCheckingPlugins []*framework.VictimCheckingPluginCollectionSpec) *apis.BinderPluginCollection
func NewBindingUnitInfo ¶
func NewBindingUnitInfo(unit *framework.QueuedUnitInfo) *bindingUnitInfo
func NewFrameworkHandle ¶
func NewFrameworkHandle( client clientset.Interface, crdClient godelclient.Interface, informerFactory informers.SharedInformerFactory, crdInformerFactory crdinformers.SharedInformerFactory, options binderOptions, binderCache godelcache.BinderCache, volumeBindingTimeoutSeconds int64, ) handle.BinderFrameworkHandle
func ValidateUnit ¶
func ValidateUnit(unit *framework.QueuedUnitInfo) error
Types ¶
type APICallFailedTask ¶
type APICallFailedTask struct {
// contains filtered or unexported fields
}
type Binder ¶
type Binder struct { // SchedulerName here is the higher level scheduler name, which is used to select pods // that godel schedulers should be responsible for and filter out irrelevant pods. SchedulerName *string // Close this to shut down the scheduler. StopEverything <-chan struct{} // It is expected that changes made via BinderCache will be observed // by NodeLister and Algorithm. BinderCache godelcache.BinderCache // BinderQueue holds pods which have nominated nodes and // need to resolve conflicts BinderQueue queue.BinderQueue // 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. NextUnit func() *framework.QueuedUnitInfo // Error is called if there is an error. It is passed the pod in // question, and the error Error func(*framework.QueuedPodInfo, error) // contains filtered or unexported fields }
Binder watches for assumed pods from multiple schedulers, and binds pods if no conflicts, otherwise, rejects the pods.
func New ¶
func New( client clientset.Interface, crdClient godelclient.Interface, informerFactory informers.SharedInformerFactory, crdInformerFactory crdinformers.SharedInformerFactory, katalystCrdInformerFactory katalystinformers.SharedInformerFactory, stopCh <-chan struct{}, recorder events.EventRecorder, schedulerName *string, volumeBindingTimeoutSeconds int64, reservationTTL time.Duration, opts ...Option, ) (*Binder, error)
New returns a Binder
func (*Binder) CheckCrossNodePreemptionForUnit ¶
func (*Binder) CheckCrossNodeTopologyForUnit ¶
func (*Binder) CheckSameNodeConflictsForUnit ¶
func (*Binder) DeleteVictimsAndBindTasks ¶
func (binder *Binder) DeleteVictimsAndBindTasks(ctx context.Context, unitInfo *bindingUnitInfo) error
all tasks (in ready and waiting list) are assumed (new tasks are also added to cache) when coming here
func (*Binder) FailAndRejectAllTasks ¶
TODO: emit events ?
func (*Binder) InitializeUnit ¶
func (binder *Binder) InitializeUnit(unit *framework.QueuedUnitInfo) *bindingUnitInfo
func (*Binder) MarkVictimsAndAssumeTasks ¶
func (*Binder) ReEnqueueWaitingTasks ¶
func (binder *Binder) ReEnqueueWaitingTasks(unitInfo *bindingUnitInfo)
func (*Binder) RejectFailedTasks ¶
func (binder *Binder) RejectFailedTasks(unitInfo *bindingUnitInfo)
TODO: figure out what can we do if fail to reject tasks
func (*Binder) RejectTimeOutUnit ¶
func (binder *Binder) RejectTimeOutUnit(unit *framework.QueuedUnitInfo)
func (*Binder) Run ¶
Run begins watching and scheduling. It waits for cache to be synced, then starts scheduling and blocked until the context is done.
func (*Binder) UnitTimeout ¶
func (binder *Binder) UnitTimeout(unit *framework.QueuedUnitInfo) bool
type BinderTasksReconciler ¶
type BinderTasksReconciler struct { APICallFailedTaskQueue workqueue.RateLimitingInterface // contains filtered or unexported fields }
func NewBinderTaskReconciler ¶
func NewBinderTaskReconciler(client clientset.Interface) *BinderTasksReconciler
func (*BinderTasksReconciler) APICallFailedWorker ¶
func (btr *BinderTasksReconciler) APICallFailedWorker()
func (*BinderTasksReconciler) AddFailedTask ¶
func (btr *BinderTasksReconciler) AddFailedTask(ft *APICallFailedTask)
func (*BinderTasksReconciler) Close ¶
func (btr *BinderTasksReconciler) Close()
func (*BinderTasksReconciler) Run ¶
func (btr *BinderTasksReconciler) Run()
type Option ¶
type Option func(*binderOptions)
Option configures a Scheduler
func WithPluginsAndConfigs ¶
func WithPluginsAndConfigs(profile *config.GodelBinderProfile) Option
WithPluginsAndConfigs sets Preemption Plugins and Configs, the default value is nil
type TaskSetGroupByNode ¶
type TaskSetGroupByNode struct { // nodes that tasks are scheduled to Nodes sets.String // first key is node name, value are tasks scheduled to that node // second is pod UID Tasks map[string]map[types.UID]*runningUnitInfo // first key is node name, value are victims on that node // second key is pod UID VictimsGroupByNode map[string]map[types.UID]*v1.Pod }