Documentation ¶
Index ¶
- Constants
- Variables
- func CreateOrUpdateReservationOptions(job *sev1alpha1.PodMigrationJob, pod *corev1.Pod) *sev1alpha1.PodMigrateReservationOptions
- func GenerateReserveResourceOwners(pod *corev1.Pod) []sev1alpha1.ReservationOwner
- func GetReservationCondition(r Object, conditionType sev1alpha1.ReservationConditionType, reason string) *sev1alpha1.ReservationCondition
- func GetReservationNamespacedName(ref *corev1.ObjectReference) types.NamespacedName
- func GetUnschedulableCondition(r Object) *sev1alpha1.ReservationCondition
- func IsReservationAvailable(r Object) bool
- func IsReservationExpired(r Object) bool
- func IsReservationFailed(r Object) bool
- func IsReservationPending(r Object) bool
- func IsReservationScheduled(r Object) bool
- func IsReservationSucceeded(r Object) bool
- type Interpreter
- type Object
- type Preemption
- type Reservation
- func (r *Reservation) GetBoundPod() *corev1.ObjectReference
- func (r *Reservation) GetPhase() sev1alpha1.ReservationPhase
- func (r *Reservation) GetReservationConditions() []sev1alpha1.ReservationCondition
- func (r *Reservation) GetReservationOwners() []sev1alpha1.ReservationOwner
- func (r *Reservation) GetScheduledNodeName() string
- func (r *Reservation) NeedPreemption() bool
- func (r *Reservation) OriginObject() client.Object
- func (r *Reservation) QueryPreemptedPodsRefs() []corev1.ObjectReference
- func (r *Reservation) String() string
Constants ¶
View Source
const ( DefaultCreator = "koord-descheduler" LabelCreatedBy = "app.kubernetes.io/created-by" )
Variables ¶
View Source
var NewInterpreter = newInterpreter
Functions ¶
func CreateOrUpdateReservationOptions ¶
func CreateOrUpdateReservationOptions(job *sev1alpha1.PodMigrationJob, pod *corev1.Pod) *sev1alpha1.PodMigrateReservationOptions
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
IsReservationAvailable checks if the reservation is scheduled on a node and its status is Available.
func IsReservationExpired ¶ added in v0.7.0
func IsReservationFailed ¶ added in v0.7.0
func IsReservationPending ¶ added in v0.7.0
func IsReservationScheduled ¶ added in v0.7.0
func IsReservationSucceeded ¶ added in v0.7.0
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
Click to show internal directories.
Click to hide internal directories.