scheduling

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PrioritizerBalance                   string = "Balance"
	PrioritizerSteady                    string = "Steady"
	PrioritizerResourceAllocatableCPU    string = "ResourceAllocatableCPU"
	PrioritizerResourceAllocatableMemory string = "ResourceAllocatableMemory"
)

Variables

This section is empty.

Functions

func NewPluginScheduler

func NewPluginScheduler(handle plugins.Handle) *pluginScheduler

func NewSchedulerHandler

func NewSchedulerHandler(
	clusterClient clusterclient.Interface,
	placementDecisionLister clusterlisterv1beta1.PlacementDecisionLister,
	scoreLister clusterlisterv1alpha1.AddOnPlacementScoreLister,
	clusterLister clusterlisterv1.ManagedClusterLister,
	eventsRecorder kevents.EventRecorder,
	metricsRecorder *metrics.ScheduleMetrics,
) plugins.Handle

func NewSchedulingController

NewSchedulingController return an instance of schedulingController

Types

type FilterResult

type FilterResult struct {
	Name             string   `json:"name"`
	FilteredClusters []string `json:"filteredClusters"`
}

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

type PrioritizerScore map[string]int64

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 decision groups of the schedule
	Decisions() []*clusterapiv1.ManagedCluster

	// 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

Jump to

Keyboard shortcuts

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