reservation

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCreator = "koord-descheduler"
	LabelCreatedBy = "app.kubernetes.io/created-by"
)

Variables

View Source
var NewInterpreter = newInterpreter

Functions

func GenerateReserveResourceOwners

func GenerateReserveResourceOwners(pod *corev1.Pod) []sev1alpha1.ReservationOwner

func GetReservationCondition added in v0.7.0

func GetReservationCondition(r Object, conditionType sev1alpha1.ReservationConditionType, reason string) *sev1alpha1.ReservationCondition

func GetReservationNamespacedName

func GetReservationNamespacedName(ref *corev1.ObjectReference) types.NamespacedName

func GetUnschedulableCondition added in v0.7.0

func GetUnschedulableCondition(r Object) *sev1alpha1.ReservationCondition

func IsReservationAvailable added in v0.7.0

func IsReservationAvailable(r Object) bool

IsReservationAvailable checks if the reservation is scheduled on a node and its status is Available.

func IsReservationExpired added in v0.7.0

func IsReservationExpired(r Object) bool

func IsReservationFailed added in v0.7.0

func IsReservationFailed(r Object) bool

func IsReservationPending added in v0.7.0

func IsReservationPending(r Object) bool

func IsReservationScheduled added in v0.7.0

func IsReservationScheduled(r Object) bool

func IsReservationSucceeded added in v0.7.0

func IsReservationSucceeded(r Object) bool

Types

type Interpreter

type Interpreter interface {
	GetReservationType() client.Object
	Preemption() Preemption
	CreateReservation(ctx context.Context, job *sev1alpha1.PodMigrationJob) (Object, error)
	GetReservation(ctx context.Context, reservationRef *corev1.ObjectReference) (Object, error)
	DeleteReservation(ctx context.Context, reservationRef *corev1.ObjectReference) error
}

type Object

type Object interface {
	metav1.Object
	runtime.Object
	String() string
	OriginObject() client.Object
	GetReservationConditions() []sev1alpha1.ReservationCondition
	QueryPreemptedPodsRefs() []corev1.ObjectReference
	GetBoundPod() *corev1.ObjectReference
	GetReservationOwners() []sev1alpha1.ReservationOwner
	GetScheduledNodeName() string
	GetPhase() sev1alpha1.ReservationPhase
	NeedPreemption() bool
}

func NewReservation

func NewReservation(reservation *sev1alpha1.Reservation) Object

type Preemption

type Preemption interface {
	Preempt(ctx context.Context, job *sev1alpha1.PodMigrationJob, reservationObj Object) (bool, reconcile.Result, error)
}

type Reservation

type Reservation struct {
	*sev1alpha1.Reservation
}

func (*Reservation) GetBoundPod

func (r *Reservation) GetBoundPod() *corev1.ObjectReference

func (*Reservation) GetPhase added in v0.7.0

func (r *Reservation) GetPhase() sev1alpha1.ReservationPhase

func (*Reservation) GetReservationConditions added in v0.7.0

func (r *Reservation) GetReservationConditions() []sev1alpha1.ReservationCondition

func (*Reservation) GetReservationOwners

func (r *Reservation) GetReservationOwners() []sev1alpha1.ReservationOwner

func (*Reservation) GetScheduledNodeName

func (r *Reservation) GetScheduledNodeName() string

func (*Reservation) NeedPreemption

func (r *Reservation) NeedPreemption() bool

func (*Reservation) OriginObject

func (r *Reservation) OriginObject() client.Object

func (*Reservation) QueryPreemptedPodsRefs

func (r *Reservation) QueryPreemptedPodsRefs() []corev1.ObjectReference

func (*Reservation) String

func (r *Reservation) String() string

Jump to

Keyboard shortcuts

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