core

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckClusterResource

func CheckClusterResource(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

func GetNamespacedName(obj metav1.Object) string

GetNamespacedName returns the namespaced name.

Types

type Manager

type Manager interface {
	PreFilter(context.Context, *corev1.Pod) error
	Permit(context.Context, *corev1.Pod) Status
	PostBind(context.Context, *corev1.Pod, string)
	GetPodGroup(*corev1.Pod) (string, *v1alpha1.PodGroup)
	GetCreationTimestamp(*corev1.Pod, time.Time) time.Time
	DeletePermittedPodGroup(string)
	CalculateAssignedPods(string, string) int
	ActivateSiblings(pod *corev1.Pod, state *framework.CycleState)
}

Manager defines the interfaces for PodGroup management.

type PodGroupManager

type PodGroupManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

PodGroupManager defines the scheduling operation called

func NewPodGroupManager

func NewPodGroupManager(pgClient pgclientset.Interface, snapshotSharedLister framework.SharedLister, scheduleTimeout *time.Duration,
	pgInformer pginformer.PodGroupInformer, podInformer informerv1.PodInformer) *PodGroupManager

NewPodGroupManager creates a new operation object.

func (*PodGroupManager) ActivateSiblings

func (pgMgr *PodGroupManager) ActivateSiblings(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) CalculateAssignedPods

func (pgMgr *PodGroupManager) CalculateAssignedPods(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(pgFullName string)

DeletePermittedPodGroup deletes a podGroup that passes Pre-Filter but reaches PostFilter.

func (*PodGroupManager) GetCreationTimestamp

func (pgMgr *PodGroupManager) GetCreationTimestamp(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(pod *corev1.Pod) (string, *v1alpha1.PodGroup)

GetPodGroup returns the PodGroup that a Pod belongs to in cache.

func (*PodGroupManager) PatchPodGroup

func (pgMgr *PodGroupManager) PatchPodGroup(pgName string, namespace string, patch []byte) error

PatchPodGroup patches a podGroup.

func (*PodGroupManager) Permit

func (pgMgr *PodGroupManager) Permit(ctx context.Context, pod *corev1.Pod) Status

Permit permits a pod to run, if the minMember match, it would send a signal to chan.

func (*PodGroupManager) PostBind

func (pgMgr *PodGroupManager) PostBind(ctx context.Context, pod *corev1.Pod, nodeName string)

PostBind updates a PodGroup's status. TODO: move this logic to PodGroup's controller.

func (*PodGroupManager) PreFilter

func (pgMgr *PodGroupManager) PreFilter(ctx context.Context, pod *corev1.Pod) error

PreFilter filters out a pod if 1. it belongs to a podgroup that was recently denied or 2. the total number of pods in the podgroup is less than the minimum number of pods that is required to be scheduled.

type Status

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"
)

Jump to

Keyboard shortcuts

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