Documentation
¶
Index ¶
- Constants
- func New(_ context.Context, _ runtime.Object, fh fwk.Handle, fts feature.Features) (fwk.Plugin, error)
- type GangScheduling
- func (pl *GangScheduling) EventsToRegister(_ context.Context) ([]fwk.ClusterEventWithHint, error)
- func (pl *GangScheduling) Name() string
- func (pl *GangScheduling) Permit(ctx context.Context, state fwk.CycleState, pod *v1.Pod, nodeName string) (*fwk.Status, time.Duration)
- func (pl *GangScheduling) PreEnqueue(ctx context.Context, pod *v1.Pod) *fwk.Status
- func (pl *GangScheduling) Reserve(ctx context.Context, cs fwk.CycleState, pod *v1.Pod, nodeName string) *fwk.Status
- func (pl *GangScheduling) Unreserve(ctx context.Context, cs fwk.CycleState, pod *v1.Pod, nodeName string)
Constants ¶
const ( // Name is the name of the plugin used in the plugin registry and configurations. Name = names.GangScheduling )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GangScheduling ¶
type GangScheduling struct {
// contains filtered or unexported fields
}
GangScheduling is a plugin that enforces "all-or-nothing" scheduling for pods belonging to a Workload with a Gang scheduling policy.
func (*GangScheduling) EventsToRegister ¶
func (pl *GangScheduling) EventsToRegister(_ context.Context) ([]fwk.ClusterEventWithHint, error)
EventsToRegister returns the possible events that may make a Pod failed by this plugin schedulable.
func (*GangScheduling) Name ¶
func (pl *GangScheduling) Name() string
Name returns name of the plugin.
func (*GangScheduling) Permit ¶
func (pl *GangScheduling) Permit(ctx context.Context, state fwk.CycleState, pod *v1.Pod, nodeName string) (*fwk.Status, time.Duration)
Permit forces all pods in a gang to wait at this stage. Once the number of waiting (assumed) pods reaches the gang's MinCount, all pods in the gang are permitted to proceed to binding simultaneously.
func (*GangScheduling) PreEnqueue ¶
PreEnqueue checks if the pod belongs to a gang and, if so, whether the gang has met its MinCount of available pods. If not, the pod is rejected until more pods arrive.
func (*GangScheduling) Reserve ¶
func (pl *GangScheduling) Reserve(ctx context.Context, cs fwk.CycleState, pod *v1.Pod, nodeName string) *fwk.Status
Reserve is called after a node has been selected for the pod. For gang pods, this stage marks the pod as "assumed" in the WorkloadManager, contributing to the count of pods ready to be co-scheduled at the Permit stage.
func (*GangScheduling) Unreserve ¶
func (pl *GangScheduling) Unreserve(ctx context.Context, cs fwk.CycleState, pod *v1.Pod, nodeName string)
Unreserve removes the gang pod from the "assumed" state in the WorkloadManager, ensuring it doesn't count towards the Permit quorum.