Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDefaultScheduler ¶
NewDefaultScheduler creates a new default scheduler
Types ¶
type ClusterState ¶
type ClusterState struct { // Nodes is a map between node name and k8s Node obj Nodes map[string]*corev1.Node // MaintenanceInProgress hold all NodeMaintenance objects that are currently in progress MaintenanceInProgress []*maintenancev1.NodeMaintenance // MaintenancePending holds all NodeMaintenance that are pending to be scheduled MaintenancePending []*maintenancev1.NodeMaintenance }
ClusterState represent the state of the cluster for Scheduler
func NewClusterState ¶
func NewClusterState(nodes []*corev1.Node, nodeMaintenances []*maintenancev1.NodeMaintenance) *ClusterState
NewClusterState returns a new ClusterState
type Scheduler ¶
type Scheduler interface { // Schedule returns the next set of NodeMaintenance objects to be scheduled. Schedule(clusterState *ClusterState, schedulerCtx *SchedulerContext) []*maintenancev1.NodeMaintenance }
Scheduler defines an interface for scheduling NodeMaintenance requests
type SchedulerContext ¶
type SchedulerContext struct { // AvailableSlots is the number of Maintenance slots available AvailableSlots int CanBecomeUnavailable int // CandidateNodes is the Set of nodes that must be considered for maintenance CandidateNodes sets.Set[string] // CandidateMaintenance is a list of NodeMaintenance that must be considered for scheduling CandidateMaintenance []*maintenancev1.NodeMaintenance }
SchedulerContext contains pre-scheduling information
Click to show internal directories.
Click to hide internal directories.