Documentation ¶
Index ¶
- Constants
- func New(obj runtime.Object, handle framework.Handle) (framework.Plugin, error)
- type Coscheduling
- func (cs *Coscheduling) AfterPreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
- func (cs *Coscheduling) BeforePreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*v1.Pod, bool, *framework.Status)
- func (cs *Coscheduling) EventsToRegister() []framework.ClusterEventWithHint
- func (cs *Coscheduling) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
- func (cs *Coscheduling) Name() string
- func (cs *Coscheduling) NewControllers() ([]frameworkext.Controller, error)
- func (cs *Coscheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
- func (cs *Coscheduling) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
- func (cs *Coscheduling) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, ...) (*framework.PostFilterResult, *framework.Status)
- func (cs *Coscheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
- func (cs *Coscheduling) PreFilterExtensions() framework.PreFilterExtensions
- func (cs *Coscheduling) RegisterEndpoints(group *gin.RouterGroup)
- func (cs *Coscheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
- func (cs *Coscheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
Constants ¶
const (
// Name is the name of the plugin used in Registry and configurations.
Name = "Coscheduling"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coscheduling ¶
type Coscheduling struct {
// contains filtered or unexported fields
}
Coscheduling is a plugin that schedules pods in a group.
func (*Coscheduling) AfterPreFilter ¶ added in v1.5.0
func (cs *Coscheduling) AfterPreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
func (*Coscheduling) BeforePreFilter ¶ added in v1.5.0
func (cs *Coscheduling) BeforePreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*v1.Pod, bool, *framework.Status)
BeforePreFilter if non-strict-mode, we only do step1 and step2: i.Check whether childes in Gang has met the requirements of minimum number under each Gang, and reject the pod if negative. ii.Check whether the Gang has been timeout(check the pod's annotation,later introduced at Permit section) or is inited, and reject the pod if positive. iii.Check whether the Gang has met the scheduleCycleValid check, and reject the pod if negative. iv.Try update scheduleCycle, scheduleCycleValid, childrenScheduleRoundMap as mentioned above.
func (*Coscheduling) EventsToRegister ¶
func (cs *Coscheduling) EventsToRegister() []framework.ClusterEventWithHint
func (*Coscheduling) Less ¶
func (cs *Coscheduling) Less(podInfo1, podInfo2 *framework.QueuedPodInfo) bool
Less is sorting pods in the scheduling queue in the following order. Firstly, compare the priorities of the two pods, the higher priority (if pod's priority is equal,then compare their KoordinatorPriority at labels )is at the front of the queue, Secondly, compare Gang group ID of the two pods, pods that NOT belong to a Gang will have higher priority than pods that belongs to a Gang, Thirdly, compare the creationTimestamp of two pods, if pod belongs to a Gang, then we compare creationTimestamp of the Gang, the one created first will be at the front of the queue Finally, compare pod's namespaced name.
func (*Coscheduling) Name ¶
func (cs *Coscheduling) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*Coscheduling) NewControllers ¶ added in v1.0.0
func (cs *Coscheduling) NewControllers() ([]frameworkext.Controller, error)
func (*Coscheduling) Permit ¶
func (cs *Coscheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
Permit we will calculate all Gangs in GangGroup whether the current number of assumed-pods in each Gang meets the Gang's minimum requirement. and decide whether we should let the pod wait in Permit stage or let the whole gangGroup go binding
func (*Coscheduling) PostBind ¶
func (cs *Coscheduling) PostBind(ctx context.Context, _ *framework.CycleState, pod *v1.Pod, nodeName string)
PostBind is called after a pod is successfully bound. These plugins are used update PodGroup when pod is bound.
func (*Coscheduling) PostFilter ¶
func (cs *Coscheduling) PostFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod, filteredNodeStatusMap framework.NodeToStatusMap) (*framework.PostFilterResult, *framework.Status)
PostFilter i. If strict-mode, we will set scheduleCycleValid to false and release all assumed pods. ii. If non-strict mode, we will do nothing.
func (*Coscheduling) PreFilter ¶
func (cs *Coscheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) (*framework.PreFilterResult, *framework.Status)
func (*Coscheduling) PreFilterExtensions ¶
func (cs *Coscheduling) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns a PreFilterExtensions interface if the plugin implements one.
func (*Coscheduling) RegisterEndpoints ¶
func (cs *Coscheduling) RegisterEndpoints(group *gin.RouterGroup)
func (*Coscheduling) Reserve ¶
func (cs *Coscheduling) Reserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) *framework.Status
Reserve is the functions invoked by the framework at "reserve" extension point.
func (*Coscheduling) Unreserve ¶
func (cs *Coscheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
Unreserve i. handle the timeout gang ii. do nothing when bound failed