Documentation ¶
Index ¶
- func CheckClusterResource(ctx context.Context, nodeList []*framework.NodeInfo, ...) error
- func GetNamespacedName(obj metav1.Object) string
- type Manager
- type PermitState
- type PodGroupManager
- func (pgMgr *PodGroupManager) ActivateSiblings(ctx context.Context, pod *corev1.Pod, state *framework.CycleState)
- func (pgMgr *PodGroupManager) BackoffPodGroup(pgName string, backoff time.Duration)
- func (pgMgr *PodGroupManager) CalculateAssignedPods(ctx context.Context, podGroupName, namespace string) int
- func (pgMgr *PodGroupManager) DeletePermittedPodGroup(_ context.Context, pgFullName string)
- func (pgMgr *PodGroupManager) GetCreationTimestamp(ctx context.Context, pod *corev1.Pod, ts time.Time) time.Time
- func (pgMgr *PodGroupManager) GetPodGroup(ctx context.Context, pod *corev1.Pod) (string, *v1alpha1.PodGroup)
- func (pgMgr *PodGroupManager) Permit(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) Status
- func (pgMgr *PodGroupManager) PreFilter(ctx context.Context, pod *corev1.Pod) error
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckClusterResource ¶
func CheckClusterResource(ctx context.Context, nodeList []*framework.NodeInfo, resourceRequest corev1.ResourceList, desiredPodGroupName string) error
CheckClusterResource checks if resource capacity of the cluster can satisfy <resourceRequest>. It returns an error detailing the resource gap if not satisfied; otherwise returns nil.
func GetNamespacedName ¶
GetNamespacedName returns the namespaced name.
Types ¶
type Manager ¶
type Manager interface { PreFilter(context.Context, *corev1.Pod) error Permit(context.Context, *framework.CycleState, *corev1.Pod) Status GetPodGroup(context.Context, *corev1.Pod) (string, *v1alpha1.PodGroup) GetCreationTimestamp(context.Context, *corev1.Pod, time.Time) time.Time DeletePermittedPodGroup(context.Context, string) CalculateAssignedPods(context.Context, string, string) int ActivateSiblings(ctx context.Context, pod *corev1.Pod, state *framework.CycleState) BackoffPodGroup(string, time.Duration) }
Manager defines the interfaces for PodGroup management.
type PermitState ¶ added in v0.28.9
type PermitState struct {
Activate bool
}
func (*PermitState) Clone ¶ added in v0.28.9
func (s *PermitState) Clone() framework.StateData
type PodGroupManager ¶
PodGroupManager defines the scheduling operation called
func NewPodGroupManager ¶
func NewPodGroupManager(client client.Client, snapshotSharedLister framework.SharedLister, scheduleTimeout *time.Duration, podInformer informerv1.PodInformer) *PodGroupManager
NewPodGroupManager creates a new operation object.
func (*PodGroupManager) ActivateSiblings ¶ added in v0.22.6
func (pgMgr *PodGroupManager) ActivateSiblings(ctx context.Context, pod *corev1.Pod, state *framework.CycleState)
ActivateSiblings stashes the pods belonging to the same PodGroup of the given pod in the given state, with a reserved key "kubernetes.io/pods-to-activate".
func (*PodGroupManager) BackoffPodGroup ¶ added in v0.26.7
func (pgMgr *PodGroupManager) BackoffPodGroup(pgName string, backoff time.Duration)
func (*PodGroupManager) CalculateAssignedPods ¶
func (pgMgr *PodGroupManager) CalculateAssignedPods(ctx context.Context, podGroupName, namespace string) int
CalculateAssignedPods returns the number of pods that has been assigned nodes: assumed or bound.
func (*PodGroupManager) DeletePermittedPodGroup ¶
func (pgMgr *PodGroupManager) DeletePermittedPodGroup(_ context.Context, pgFullName string)
DeletePermittedPodGroup deletes a podGroup that passes Pre-Filter but reaches PostFilter.
func (*PodGroupManager) GetCreationTimestamp ¶
func (pgMgr *PodGroupManager) GetCreationTimestamp(ctx context.Context, pod *corev1.Pod, ts time.Time) time.Time
GetCreationTimestamp returns the creation time of a podGroup or a pod.
func (*PodGroupManager) GetPodGroup ¶
func (pgMgr *PodGroupManager) GetPodGroup(ctx context.Context, pod *corev1.Pod) (string, *v1alpha1.PodGroup)
GetPodGroup returns the PodGroup that a Pod belongs to in cache.
func (*PodGroupManager) Permit ¶
func (pgMgr *PodGroupManager) Permit(ctx context.Context, state *framework.CycleState, pod *corev1.Pod) Status
Permit permits a pod to run, if the minMember match, it would send a signal to chan.
type Status ¶ added in v0.22.6
type Status string
const ( // PodGroupNotSpecified denotes no PodGroup is specified in the Pod spec. PodGroupNotSpecified Status = "PodGroup not specified" // PodGroupNotFound denotes the specified PodGroup in the Pod spec is // not found in API server. PodGroupNotFound Status = "PodGroup not found" Success Status = "Success" Wait Status = "Wait" )