You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ReservationNominator nominates a more suitable Reservation in the Reserve stage and Pod will bind this Reservation.
// The Reservation will be recorded in CycleState through SetNominatedReservation.
// When executing Reserve, each plugin will obtain the currently used Reservation through GetNominatedReservation,
// and locate the previously returned reusable resources for Pod allocation.
type ReservationNominator interface {
framework.Plugin
NominateReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, nodeName string) (*ReservationInfo, *framework.Status)
AddNominatedReservation(pod *corev1.Pod, nodeName string, rInfo *ReservationInfo)
RemoveNominatedReservations(pod *corev1.Pod)
GetNominatedReservation(pod *corev1.Pod, nodeName string) *ReservationInfo
}
// ReservationFilterPlugin is an interface for Filter Reservation plugins.
// These plugins will be called during the Reserve phase to determine whether the Reservation can participate in the Reserve
type ReservationFilterPlugin interface {
framework.Plugin
FilterReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *ReservationInfo, nodeName string) *framework.Status
}
// ReservationScorePlugin is an interface that must be implemented by "ScoreReservation" plugins to rank
// reservations that passed the reserve phase.
type ReservationScorePlugin interface {
framework.Plugin
ScoreReservation(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, reservationInfo *ReservationInfo, nodeName string) (int64, *framework.Status)
// ReservationScoreExtensions returns a ReservationScoreExtensions interface if it implements one, or nil if does not.
ReservationScoreExtensions() ReservationScoreExtensions
}
// ReservationScoreExtensions is an interface for Score extended functionality.
type ReservationScoreExtensions interface {
// NormalizeReservationScore is called for all node scores produced by the same plugin's "ScoreReservation"
// method. A successful run of NormalizeReservationScore will update the scores list and return
// a success status.
NormalizeReservationScore(ctx context.Context, cycleState *framework.CycleState, pod *corev1.Pod, scores ReservationScoreList) *framework.Status
}
目前的设计是:不同插件在 Filter 阶段分别判断节点上是否有 Reservation 可以满足资源诉求,但是完全有可能出现一个 Reservation 满足 CPU 但是 GPU 不满足,另一个 Reservation 满足 GPU 但是 CPU 不满足,这种节点会在 Filter 阶段会通过,所以这部分需要重新设计。
目前调度器已经支持了 ReservationNominator 接口,该接口由 Reservation 插件实现,NominateReservation 函数的实现中会调用所有实现了 ReservationFilter、ReservationScore 接口的插件尝试在节点上选出资源条件最满足的 Reservation。
所以调用 NominateReservation 函数即可判断出节点是否有 Reservation 满足所有的资源诉求,这里考虑修改 Filter 的流程,使得:
The text was updated successfully, but these errors were encountered: