gangscheduling

package
v1.35.0-beta.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Name is the name of the plugin used in the plugin registry and configurations.
	Name = names.GangScheduling
)

Variables

This section is empty.

Functions

func New

New initializes a new plugin and returns it.

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

func (pl *GangScheduling) PreEnqueue(ctx context.Context, pod *v1.Pod) *fwk.Status

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL