Documentation ¶
Index ¶
- Variables
- func GetReservationKey(r *schedulingv1alpha1.Reservation) string
- func GetReservationNameFromReservePod(pod *corev1.Pod) string
- func GetReservationNodeName(r *schedulingv1alpha1.Reservation) string
- func GetReservationRestrictedResources(allocatableResources []corev1.ResourceName, ...) []corev1.ResourceName
- func GetReservationSchedulerName(r *schedulingv1alpha1.Reservation) string
- func GetReservePodNamespacedName(r *schedulingv1alpha1.Reservation) types.NamespacedName
- func GetReservePodNodeName(pod *corev1.Pod) string
- func IsObjValidActiveReservation(obj interface{}) bool
- func IsReservationActive(r *schedulingv1alpha1.Reservation) bool
- func IsReservationAvailable(r *schedulingv1alpha1.Reservation) bool
- func IsReservationExpired(r *schedulingv1alpha1.Reservation) bool
- func IsReservationFailed(r *schedulingv1alpha1.Reservation) bool
- func IsReservationSucceeded(r *schedulingv1alpha1.Reservation) bool
- func IsReservePod(pod *corev1.Pod) bool
- func MatchObjectRef(pod *corev1.Pod, objRef *corev1.ObjectReference) bool
- func MatchReservationControllerReference(pod *corev1.Pod, ...) bool
- func MatchReservationOwners(pod *corev1.Pod, matchers []ReservationOwnerMatcher) bool
- func NewReservationToPodEventHandler(handler cache.ResourceEventHandler, filters ...func(obj interface{}) bool) cache.ResourceEventHandler
- func NewReservePod(r *schedulingv1alpha1.Reservation) *corev1.Pod
- func PodPriority(r *schedulingv1alpha1.Reservation) int32
- func ReservationRequests(r *schedulingv1alpha1.Reservation) corev1.ResourceList
- func ReservePorts(r *schedulingv1alpha1.Reservation) framework.HostPortInfo
- func SetReservationAvailable(r *schedulingv1alpha1.Reservation, nodeName string) error
- func SetReservationExpired(r *schedulingv1alpha1.Reservation)
- func SetReservationResizeAllocatable(obj metav1.Object, resizeAllocatable *ReservationResizeAllocatable) error
- func SetReservationSucceeded(r *schedulingv1alpha1.Reservation)
- func UpdateReservationResizeAllocatable(obj metav1.Object, resources corev1.ResourceList) error
- func UpdateReservePodWithAllocatable(reservePod *corev1.Pod, podRequests, allocatable corev1.ResourceList)
- func ValidateReservation(r *schedulingv1alpha1.Reservation) error
- type RequiredReservationAffinity
- type ReservationOwnerMatcher
- type ReservationResizeAllocatable
- type ReservationToPodEventHandler
Constants ¶
This section is empty.
Variables ¶
var ( // AnnotationReservePod indicates whether the pod is a reserved pod. AnnotationReservePod = extension.SchedulingDomainPrefix + "/reserve-pod" // AnnotationReservationName indicates the name of the reservation. AnnotationReservationName = extension.SchedulingDomainPrefix + "/reservation-name" // AnnotationReservationNode indicates the node name if the reservation specifies a node. AnnotationReservationNode = extension.SchedulingDomainPrefix + "/reservation-node" // AnnotationReservationResizeAllocatable indicates the desired allocatable are to be updated. AnnotationReservationResizeAllocatable = extension.SchedulingDomainPrefix + "/reservation-resize-allocatable" )
Functions ¶
func GetReservationKey ¶
func GetReservationKey(r *schedulingv1alpha1.Reservation) string
func GetReservationNodeName ¶
func GetReservationNodeName(r *schedulingv1alpha1.Reservation) string
func GetReservationRestrictedResources ¶ added in v1.5.0
func GetReservationRestrictedResources(allocatableResources []corev1.ResourceName, options *extension.ReservationRestrictedOptions) []corev1.ResourceName
func GetReservationSchedulerName ¶
func GetReservationSchedulerName(r *schedulingv1alpha1.Reservation) string
func GetReservePodNamespacedName ¶ added in v1.3.0
func GetReservePodNamespacedName(r *schedulingv1alpha1.Reservation) types.NamespacedName
func GetReservePodNodeName ¶
func IsObjValidActiveReservation ¶
func IsObjValidActiveReservation(obj interface{}) bool
func IsReservationActive ¶
func IsReservationActive(r *schedulingv1alpha1.Reservation) bool
IsReservationActive checks if the reservation is scheduled and its status is Available/Waiting (active to use).
func IsReservationAvailable ¶
func IsReservationAvailable(r *schedulingv1alpha1.Reservation) bool
IsReservationAvailable checks if the reservation is scheduled on a node and its status is Available.
func IsReservationExpired ¶
func IsReservationExpired(r *schedulingv1alpha1.Reservation) bool
func IsReservationFailed ¶
func IsReservationFailed(r *schedulingv1alpha1.Reservation) bool
func IsReservationSucceeded ¶
func IsReservationSucceeded(r *schedulingv1alpha1.Reservation) bool
func IsReservePod ¶
func MatchObjectRef ¶
func MatchObjectRef(pod *corev1.Pod, objRef *corev1.ObjectReference) bool
func MatchReservationControllerReference ¶
func MatchReservationControllerReference(pod *corev1.Pod, controllerRef *schedulingv1alpha1.ReservationControllerReference) bool
func MatchReservationOwners ¶
func MatchReservationOwners(pod *corev1.Pod, matchers []ReservationOwnerMatcher) bool
MatchReservationOwners checks if the scheduling pod matches the reservation's owner spec. `reservation.spec.owners` defines the DNF (disjunctive normal form) of ObjectReference, ControllerReference (extended), LabelSelector, which means multiple selectors are firstly ANDed and secondly ORed.
func NewReservationToPodEventHandler ¶
func NewReservationToPodEventHandler(handler cache.ResourceEventHandler, filters ...func(obj interface{}) bool) cache.ResourceEventHandler
func NewReservePod ¶
func NewReservePod(r *schedulingv1alpha1.Reservation) *corev1.Pod
NewReservePod returns a fake pod set as the reservation's specifications. The reserve pod is only visible for the scheduler and does not make actual creation on nodes.
func PodPriority ¶ added in v1.3.0
func PodPriority(r *schedulingv1alpha1.Reservation) int32
func ReservationRequests ¶
func ReservationRequests(r *schedulingv1alpha1.Reservation) corev1.ResourceList
func ReservePorts ¶
func ReservePorts(r *schedulingv1alpha1.Reservation) framework.HostPortInfo
func SetReservationAvailable ¶
func SetReservationAvailable(r *schedulingv1alpha1.Reservation, nodeName string) error
func SetReservationExpired ¶
func SetReservationExpired(r *schedulingv1alpha1.Reservation)
func SetReservationResizeAllocatable ¶ added in v1.4.0
func SetReservationResizeAllocatable(obj metav1.Object, resizeAllocatable *ReservationResizeAllocatable) error
func SetReservationSucceeded ¶
func SetReservationSucceeded(r *schedulingv1alpha1.Reservation)
func UpdateReservationResizeAllocatable ¶ added in v1.4.0
func UpdateReservationResizeAllocatable(obj metav1.Object, resources corev1.ResourceList) error
UpdateReservationResizeAllocatable replaces or add the resources to the resizeAllocatable.
func UpdateReservePodWithAllocatable ¶ added in v1.4.0
func UpdateReservePodWithAllocatable(reservePod *corev1.Pod, podRequests, allocatable corev1.ResourceList)
func ValidateReservation ¶
func ValidateReservation(r *schedulingv1alpha1.Reservation) error
Types ¶
type RequiredReservationAffinity ¶ added in v1.3.0
type RequiredReservationAffinity struct {
// contains filtered or unexported fields
}
func GetRequiredReservationAffinity ¶ added in v1.3.0
func GetRequiredReservationAffinity(pod *corev1.Pod) (*RequiredReservationAffinity, error)
GetRequiredReservationAffinity returns the parsing result of pod's nodeSelector and nodeAffinity.
type ReservationOwnerMatcher ¶ added in v1.4.0
type ReservationOwnerMatcher struct { schedulingv1alpha1.ReservationOwner Selector labels.Selector }
func ParseReservationOwnerMatchers ¶ added in v1.4.0
func ParseReservationOwnerMatchers(owners []schedulingv1alpha1.ReservationOwner) ([]ReservationOwnerMatcher, error)
type ReservationResizeAllocatable ¶ added in v1.4.0
type ReservationResizeAllocatable struct {
Resources corev1.ResourceList `json:"resources,omitempty"`
}
func GetReservationResizeAllocatable ¶ added in v1.4.0
func GetReservationResizeAllocatable(annotations map[string]string) (*ReservationResizeAllocatable, error)
type ReservationToPodEventHandler ¶
type ReservationToPodEventHandler struct {
// contains filtered or unexported fields
}
ReservationToPodEventHandler can be used to handle reservation events with a pod event handler, which converts each reservation object into the corresponding reserve pod object.
e.g. func registerReservationEventHandler(handle framework.Handle, podHandler podHandler) { extendedHandle, ok := handle.(frameworkext.ExtendedHandle) if !ok { // if not implement extendedHandle, ignore reservation events klog.V(3).Infof("registerReservationEventHandler aborted, cannot convert handle to frameworkext.ExtendedHandle, got %T", handle) return } extendedHandle.KoordinatorSharedInformerFactory().Scheduling().V1alpha1().Reservations().Informer(). AddEventHandler(util.NewReservationToPodEventHandler(&podHandler, IsObjValidActiveReservation)) }
func (ReservationToPodEventHandler) OnAdd ¶
func (r ReservationToPodEventHandler) OnAdd(obj interface{}, isInInitialList bool)
func (ReservationToPodEventHandler) OnDelete ¶
func (r ReservationToPodEventHandler) OnDelete(obj interface{})
OnDelete calls DeleteFunc if it's not nil.
func (ReservationToPodEventHandler) OnUpdate ¶
func (r ReservationToPodEventHandler) OnUpdate(oldObj, newObj interface{})
OnUpdate calls UpdateFunc if it's not nil.