reservation

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name = "Reservation"

	// ErrReasonReservationAffinity is the reason for Pod's reservation affinity/selector not matching.
	ErrReasonReservationAffinity = "node(s) no reservations match reservation affinity"
	// ErrReasonNodeNotMatchReservation is the reason for node not matching which the reserve pod specifies.
	ErrReasonNodeNotMatchReservation = "node(s) didn't match the nodeName specified by reservation"
	// ErrReasonReservationAllocatePolicyConflict is the reason for the AllocatePolicy of the Reservation conflicts with other Reservations on the node
	ErrReasonReservationAllocatePolicyConflict = "node(s) reservation allocate policy conflict"
	// ErrReasonReservationInactive is the reason for the reservation is failed/succeeded and should not be used.
	ErrReasonReservationInactive = "reservation is not active"
	// ErrReasonNoReservationsMeetRequirements is the reason for no reservation(s) to meet the requirements.
	ErrReasonNoReservationsMeetRequirements = "node(s) no reservation(s) to meet the requirements"
	// ErrReasonPreemptionFailed is the reason for preemption failed
	ErrReasonPreemptionFailed = "node(s) preemption failed due to insufficient resources"
)

Variables

This section is empty.

Functions

func New

func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error)

func SetReservationCache added in v1.3.0

func SetReservationCache(cache ReservationCache)

Types

type NodeReservations added in v1.3.0

type NodeReservations struct {
	Items []ReservationItem `json:"items,omitempty"`
}

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) AddNominatedReservation added in v1.4.0

func (pl *Plugin) AddNominatedReservation(pod *corev1.Pod, nodeName string, rInfo *frameworkext.ReservationInfo)

func (*Plugin) AddNominatedReservePod added in v1.5.0

func (pl *Plugin) AddNominatedReservePod(pod *corev1.Pod, nodeName string)

func (*Plugin) AddPod added in v1.3.0

func (pl *Plugin) AddPod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *corev1.Pod, podInfoToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*Plugin) AfterPreFilter added in v1.2.0

func (pl *Plugin) AfterPreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) *framework.Status

func (*Plugin) BeforeFilter added in v1.2.0

func (pl *Plugin) BeforeFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) (*corev1.Pod, *framework.NodeInfo, bool, *framework.Status)

func (*Plugin) BeforePreFilter added in v1.2.0

func (pl *Plugin) BeforePreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) (*corev1.Pod, bool, *framework.Status)

func (*Plugin) Bind

func (pl *Plugin) Bind(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) *framework.Status

Bind fake binds reserve pod and mark corresponding reservation as Available. NOTE: This Bind plugin should get called before DefaultBinder; plugin order should be configured.

func (*Plugin) DeleteNominatedReservePod added in v1.5.0

func (pl *Plugin) DeleteNominatedReservePod(pod *corev1.Pod)

func (*Plugin) EventsToRegister added in v1.3.0

func (pl *Plugin) EventsToRegister() []framework.ClusterEventWithHint

func (*Plugin) Filter

func (pl *Plugin) Filter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeInfo *framework.NodeInfo) *framework.Status

Filter only processes pods either the pod is a reserve pod or a pod can allocate reserved resources on the node.

func (*Plugin) FilterReservation added in v1.2.0

func (pl *Plugin) FilterReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *frameworkext.ReservationInfo, nodeName string) *framework.Status

func (*Plugin) GetNominatedReservation added in v1.4.0

func (pl *Plugin) GetNominatedReservation(pod *corev1.Pod, nodeName string) *frameworkext.ReservationInfo

func (*Plugin) Name

func (pl *Plugin) Name() string

func (*Plugin) NewControllers added in v1.2.0

func (pl *Plugin) NewControllers() ([]frameworkext.Controller, error)

func (*Plugin) NominateReservation added in v1.2.0

func (pl *Plugin) NominateReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (*frameworkext.ReservationInfo, *framework.Status)

func (*Plugin) NormalizeScore added in v0.7.0

func (pl *Plugin) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *corev1.Pod, scores framework.NodeScoreList) *framework.Status

func (*Plugin) PostFilter

func (*Plugin) PreBind

func (pl *Plugin) PreBind(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) *framework.Status

func (*Plugin) PreFilter

func (pl *Plugin) PreFilter(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod) (*framework.PreFilterResult, *framework.Status)

PreFilter checks if the pod is a reserve pod. If it is, update cycle state to annotate reservation scheduling. Also do validations in this phase.

func (*Plugin) PreFilterExtensions

func (pl *Plugin) PreFilterExtensions() framework.PreFilterExtensions

func (*Plugin) PreScore added in v0.7.0

func (pl *Plugin) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodes []*corev1.Node) *framework.Status

func (*Plugin) RegisterEndpoints added in v1.3.0

func (pl *Plugin) RegisterEndpoints(group *gin.RouterGroup)

func (*Plugin) RemoveNominatedReservations added in v1.4.0

func (pl *Plugin) RemoveNominatedReservations(pod *corev1.Pod)

func (*Plugin) RemovePod added in v1.3.0

func (pl *Plugin) RemovePod(ctx context.Context, cycleState *framework.CycleState, podToSchedule *corev1.Pod, podInfoToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) *framework.Status

func (*Plugin) ReservationScoreExtensions added in v1.4.0

func (pl *Plugin) ReservationScoreExtensions() frameworkext.ReservationScoreExtensions

func (*Plugin) Reserve

func (pl *Plugin) Reserve(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) *framework.Status

func (*Plugin) Score

func (pl *Plugin) Score(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (int64, *framework.Status)

func (*Plugin) ScoreExtensions

func (pl *Plugin) ScoreExtensions() framework.ScoreExtensions

func (*Plugin) ScoreReservation added in v1.2.0

func (pl *Plugin) ScoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *frameworkext.ReservationInfo, nodeName string) (int64, *framework.Status)

func (*Plugin) Unreserve

func (pl *Plugin) Unreserve(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string)

type ReservationCache added in v1.3.0

type ReservationCache interface {
	DeleteReservation(r *schedulingv1alpha1.Reservation) *frameworkext.ReservationInfo
	GetReservationInfoByPod(pod *corev1.Pod, nodeName string) *frameworkext.ReservationInfo
}

func GetReservationCache added in v1.3.0

func GetReservationCache() ReservationCache

type ReservationItem added in v1.3.0

type ReservationItem struct {
	Name      string    `json:"name,omitempty"`
	Namespace string    `json:"namespace,omitempty"`
	UID       types.UID `json:"uid,omitempty"`
	Kind      string    `json:"kind,omitempty"`

	Available        bool                                         `json:"available,omitempty"`
	AllocateOnce     bool                                         `json:"allocateOnce,omitempty"`
	Allocatable      corev1.ResourceList                          `json:"allocatable,omitempty"`
	Allocated        corev1.ResourceList                          `json:"allocated,omitempty"`
	AllocatablePorts framework.HostPortInfo                       `json:"allocatablePorts,omitempty"`
	AllocatedPorts   framework.HostPortInfo                       `json:"allocatedPorts,omitempty"`
	Owners           []schedulingv1alpha1.ReservationOwner        `json:"owners,omitempty"`
	AllocatePolicy   schedulingv1alpha1.ReservationAllocatePolicy `json:"allocatePolicy,omitempty"`
	AssignedPods     []*frameworkext.PodRequirement               `json:"assignedPods,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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