Documentation ¶
Index ¶
- Constants
- Variables
- func NewPluginScheduler(handle plugins.Handle) *pluginScheduler
- func NewSchedulerHandler(clusterClient clusterclient.Interface, ...) plugins.Handle
- func NewSchedulingController(clusterClient clusterclient.Interface, ...) factory.Controller
- type FilterResult
- type PrioritizerResult
- type PrioritizerScore
- type ScheduleResult
- type Scheduler
Constants ¶
View Source
const ( PrioritizerBalance string = "Balance" PrioritizerSteady string = "Steady" PrioritizerResourceAllocatableCPU string = "ResourceAllocatableCPU" PrioritizerResourceAllocatableMemory string = "ResourceAllocatableMemory" )
Variables ¶
View Source
var ResyncInterval = time.Minute * 5
Functions ¶
func NewPluginScheduler ¶
func NewSchedulerHandler ¶
func NewSchedulerHandler( clusterClient clusterclient.Interface, placementDecisionLister clusterlisterv1beta1.PlacementDecisionLister, scoreLister clusterlisterv1alpha1.AddOnPlacementScoreLister, clusterLister clusterlisterv1.ManagedClusterLister, recorder kevents.EventRecorder) plugins.Handle
func NewSchedulingController ¶
func NewSchedulingController( clusterClient clusterclient.Interface, clusterInformer clusterinformerv1.ManagedClusterInformer, clusterSetInformer clusterinformerv1beta2.ManagedClusterSetInformer, clusterSetBindingInformer clusterinformerv1beta2.ManagedClusterSetBindingInformer, placementInformer clusterinformerv1beta1.PlacementInformer, placementDecisionInformer clusterinformerv1beta1.PlacementDecisionInformer, placementScoreInformer clusterinformerv1alpha1.AddOnPlacementScoreInformer, scheduler Scheduler, recorder events.Recorder, krecorder kevents.EventRecorder, ) factory.Controller
NewSchedulingController return an instance of schedulingController
Types ¶
type FilterResult ¶
type PrioritizerResult ¶
type PrioritizerResult struct { Name string `json:"name"` Weight int32 `json:"weight"` Scores PrioritizerScore `json:"scores"` }
PrioritizerResult defines the result of one prioritizer, include name, weight, and score of each cluster.
type PrioritizerScore ¶
PrioritizerScore defines the score for each cluster
type ScheduleResult ¶
type ScheduleResult interface { // FilterResults returns results for each filter FilterResults() []FilterResult // PrioritizerResults returns results for each prioritizer PrioritizerResults() []PrioritizerResult // PrioritizerScores returns total score for each cluster PrioritizerScores() PrioritizerScore // Decisions returns the decisions of the schedule Decisions() []clusterapiv1beta1.ClusterDecision // NumOfUnscheduled returns the number of unscheduled. NumOfUnscheduled() int // RequeueAfter returns the requeue time interval of the placement RequeueAfter() *time.Duration }
type Scheduler ¶
type Scheduler interface { Schedule( ctx context.Context, placement *clusterapiv1beta1.Placement, clusters []*clusterapiv1.ManagedCluster, ) (ScheduleResult, *framework.Status) }
Scheduler is an interface for scheduler, it returs the scheduler results
Click to show internal directories.
Click to hide internal directories.