Documentation
¶
Index ¶
- Constants
- func MakeNextUnitFunc(queue BinderQueue) func() *framework.QueuedUnitInfo
- type BinderQueue
- type Option
- type PriorityQueue
- func (p *PriorityQueue) ActiveWaitingUnit(unitKey string)
- func (p *PriorityQueue) Add(pod *v1.Pod) error
- func (p *PriorityQueue) AddUnitPreemptor(unit *framework.QueuedUnitInfo)
- func (p *PriorityQueue) Close()
- func (p *PriorityQueue) Delete(pod *v1.Pod) error
- func (p *PriorityQueue) PendingPods() []*v1.Pod
- func (p *PriorityQueue) Pop() (*framework.QueuedUnitInfo, error)
- func (p *PriorityQueue) Run()
- func (p *PriorityQueue) Update(oldPod, newPod *v1.Pod) error
Constants ¶
const ( // DefaultPodInitialBackoffDuration is the default value for the initial backoff duration // for unschedulable pods. To change the default podInitialBackoffDurationSeconds used by the // scheduler, update the ComponentConfig value in defaults.go DefaultPodInitialBackoffDuration = 1 * time.Second // DefaultPodMaxBackoffDuration is the default value for the max backoff duration // for unschedulable pods. To change the default podMaxBackoffDurationSeconds used by the // scheduler, update the ComponentConfig value in defaults.go DefaultPodMaxBackoffDuration = 10 * time.Second )
const ( // PodAdd is the event when a new pod is added to API server. PodAdd = "PodAdd" // NodeAdd is the event when a new node is added to the cluster. NodeAdd = "NodeAdd" // ScheduleAttemptFailure is the event when a schedule attempt fails. ScheduleAttemptFailure = "ScheduleAttemptFailure" // BackoffComplete is the event when a pod finishes backoff. BackoffComplete = "BackoffComplete" // UnschedulableTimeout is the event when a pod stays in unschedulable for longer than timeout. UnschedulableTimeout = "UnschedulableTimeout" // AssignedPodAdd is the event when a pod is added that causes pods with matching affinity terms // to be more schedulable. AssignedPodAdd = "AssignedPodAdd" // AssignedPodUpdate is the event when a pod is updated that causes pods with matching affinity // terms to be more schedulable. AssignedPodUpdate = "AssignedPodUpdate" // AssignedPodDelete is the event when a pod is deleted that causes pods with matching affinity // terms to be more schedulable. AssignedPodDelete = "AssignedPodDelete" // PvAdd is the event when a persistent volume is added in the cluster. PvAdd = "PvAdd" // PvUpdate is the event when a persistent volume is updated in the cluster. PvUpdate = "PvUpdate" // PvcAdd is the event when a persistent volume claim is added in the cluster. PvcAdd = "PvcAdd" // PvcUpdate is the event when a persistent volume claim is updated in the cluster. PvcUpdate = "PvcUpdate" // StorageClassAdd is the event when a StorageClass is added in the cluster. StorageClassAdd = "StorageClassAdd" // ServiceAdd is the event when a service is added in the cluster. ServiceAdd = "ServiceAdd" // ServiceUpdate is the event when a service is updated in the cluster. ServiceUpdate = "ServiceUpdate" // ServiceDelete is the event when a service is deleted in the cluster. ServiceDelete = "ServiceDelete" // CSINodeAdd is the event when a CSI node is added in the cluster. CSINodeAdd = "CSINodeAdd" // CSINodeUpdate is the event when a CSI node is updated in the cluster. CSINodeUpdate = "CSINodeUpdate" // NodeSpecUnschedulableChange is the event when unschedulable node spec is changed. NodeSpecUnschedulableChange = "NodeSpecUnschedulableChange" // NodeAllocatableChange is the event when node allocatable is changed. NodeAllocatableChange = "NodeAllocatableChange" // NodeLabelChange is the event when node label is changed. NodeLabelChange = "NodeLabelChange" // NodeTaintChange is the event when node taint is changed. NodeTaintChange = "NodeTaintChange" // NodeConditionChange is the event when node condition is changed. NodeConditionChange = "NodeConditionChange" )
Events that trigger scheduler queue to change.
Variables ¶
This section is empty.
Functions ¶
func MakeNextUnitFunc ¶
func MakeNextUnitFunc(queue BinderQueue) func() *framework.QueuedUnitInfo
MakeNextUnitFunc returns a function to retrieve the next pod from a given active queue
Types ¶
type BinderQueue ¶
type BinderQueue interface { // Add adds a pod which has a node assumed from scheduler // and need to resolve the conflict Add(pod *v1.Pod) error Update(oldPod, newPod *v1.Pod) error Delete(pod *v1.Pod) error // Pop removes the pod for resolving same node constraints Pop() (*framework.QueuedUnitInfo, error) AddUnitPreemptor(*framework.QueuedUnitInfo) PendingPods() []*v1.Pod // Run starts the goroutines managing the queue. Run() Close() // ActiveWaitingUnit move unit from waitingQ to readyQ ActiveWaitingUnit(unitKey string) }
BinderQueue watches on pod which need to resolve conflict for same node, cross node, preemption and gang scheduling
func NewBinderQueue ¶
func NewBinderQueue(lessFn framework.UnitLessFunc, pgLister v1alpha1.PodGroupLister, pcLister schev1.PriorityClassLister, cache cache.BinderCache, opts ...Option, ) BinderQueue
NewBinderQueue initializes a priority queue as a new binder queue.
type Option ¶
type Option func(*priorityQueueOptions)
Option configures a PriorityQueue
func WithPodInitialBackoffDuration ¶
WithPodInitialBackoffDuration sets pod initial backoff duration for PriorityQueue.
func WithPodMaxBackoffDuration ¶
WithPodMaxBackoffDuration sets pod max backoff duration for PriorityQueue.
type PriorityQueue ¶
type PriorityQueue struct {
// contains filtered or unexported fields
}
PriorityQueue provides the priority queues for resolving scheduling conflicts
func NewPriorityQueue ¶
func NewPriorityQueue( lessFn framework.UnitLessFunc, pgLister v1alpha1.PodGroupLister, pcLister schev1.PriorityClassLister, cache cache.BinderCache, opts ...Option, ) *PriorityQueue
func (*PriorityQueue) ActiveWaitingUnit ¶
func (p *PriorityQueue) ActiveWaitingUnit(unitKey string)
ActiveWaitingUnit checks and move unit from waitingQ to readyQ
func (*PriorityQueue) Add ¶
func (p *PriorityQueue) Add(pod *v1.Pod) error
Add adds pod with assumed node from the scheduler into respective queue based on its annotations
func (*PriorityQueue) AddUnitPreemptor ¶
func (p *PriorityQueue) AddUnitPreemptor(unit *framework.QueuedUnitInfo)
func (*PriorityQueue) Delete ¶
func (p *PriorityQueue) Delete(pod *v1.Pod) error
Delete deletes the pod from its respective queue. It assumes that pod is only present in one queue
func (*PriorityQueue) PendingPods ¶
func (p *PriorityQueue) PendingPods() []*v1.Pod
PendingPods returns all the pending pods in the queue. This function is used for debugging purposes in the scheduler cache dumper and comparer.
func (*PriorityQueue) Pop ¶
func (p *PriorityQueue) Pop() (*framework.QueuedUnitInfo, error)
Pop removes the head of the active queue and returns it. It blocks if the waitingUnitQ is empty and waits until a new item is added to the queue. It increments scheduling cycle when a pod is popped.
func (*PriorityQueue) Run ¶
func (p *PriorityQueue) Run()
Run starts the goroutine to pump from podBackoffQ to waitingUnitQ