Documentation ¶
Index ¶
- Constants
- func GetPodGroupLabels(pod *v1.Pod) (string, int, error)
- func New(config *runtime.Unknown, handle framework.FrameworkHandle) (framework.Plugin, error)
- type Args
- type Coscheduling
- func (cs *Coscheduling) Less(podInfo1, podInfo2 *framework.PodInfo) bool
- func (cs *Coscheduling) Name() string
- func (cs *Coscheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
- func (cs *Coscheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
- func (cs *Coscheduling) PreFilterExtensions() framework.PreFilterExtensions
- func (cs *Coscheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
- type PodGroupInfo
Constants ¶
const ( // Name is the name of the plugin used in Registry and configurations. Name = "Coscheduling" // PodGroupName is the name of a pod group that defines a coscheduling pod group. PodGroupName = "pod-group.scheduling.sigs.k8s.io/name" // PodGroupMinAvailable specifies the minimum number of pods to be scheduled together in a pod group. PodGroupMinAvailable = "pod-group.scheduling.sigs.k8s.io/min-available" )
Variables ¶
This section is empty.
Functions ¶
func GetPodGroupLabels ¶
GetPodGroupLabels checks if the pod belongs to a PodGroup. If so, it will return the podGroupName, minAvailable of the PodGroup. If not, it will return "" and 0.
Types ¶
type Args ¶
type Args struct { // PermitWaitingTime is the wait timeout in seconds. PermitWaitingTimeSeconds int64 // PodGroupGCInterval is the period to run gc of PodGroup in seconds. PodGroupGCIntervalSeconds int64 // If the deleted PodGroup stays longer than the PodGroupExpirationTime, // the PodGroup will be deleted from PodGroupInfos. PodGroupExpirationTimeSeconds int64 }
Args defines the scheduling parameters for Coscheduling plugin.
type Coscheduling ¶
type Coscheduling struct {
// contains filtered or unexported fields
}
Coscheduling is a plugin that implements the mechanism of gang scheduling.
func (*Coscheduling) Less ¶
func (cs *Coscheduling) Less(podInfo1, podInfo2 *framework.PodInfo) bool
Less is used to sort pods in the scheduling queue. 1. Compare the priorities of Pods. 2. Compare the initialization timestamps of PodGroups/Pods. 3. Compare the keys of PodGroups/Pods, i.e., if two pods are tied at priority and creation time, the one without podGroup will go ahead of the one with podGroup.
func (*Coscheduling) Name ¶
func (cs *Coscheduling) Name() string
Name returns name of the plugin. It is used in logs, etc.
func (*Coscheduling) Permit ¶
func (cs *Coscheduling) Permit(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (*framework.Status, time.Duration)
Permit is the functions invoked by the framework at "Permit" extension point.
func (*Coscheduling) PreFilter ¶
func (cs *Coscheduling) PreFilter(ctx context.Context, state *framework.CycleState, pod *v1.Pod) *framework.Status
PreFilter performs the following validations.
- Validate if minAvailables and priorities of all the pods in a PodGroup are the same.
- Validate if the total number of pods belonging to the same `PodGroup` is less than `minAvailable`. If so, the scheduling process will be interrupted directly to avoid the partial Pods and hold the system resources until a timeout. It will reduce the overall scheduling time for the whole group.
func (*Coscheduling) PreFilterExtensions ¶
func (cs *Coscheduling) PreFilterExtensions() framework.PreFilterExtensions
PreFilterExtensions returns nil.
func (*Coscheduling) Unreserve ¶
func (cs *Coscheduling) Unreserve(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string)
Unreserve rejects all other Pods in the PodGroup when one of the pods in the group times out.
type PodGroupInfo ¶
type PodGroupInfo struct {
// contains filtered or unexported fields
}
PodGroupInfo is a wrapper to a PodGroup with additional information. A PodGroup's priority, timestamp and minAvailable are set according to the values of the PodGroup's first pod that is added to the scheduling queue.