core

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DuplicatedStrategy indicates each candidate member cluster will directly apply the original replicas.
	DuplicatedStrategy = "Duplicated"
	// AggregatedStrategy indicates dividing replicas among clusters as few as possible and
	// taking clusters' available replicas into consideration as well.
	AggregatedStrategy = "Aggregated"
	// StaticWeightStrategy indicates dividing replicas by static weight according to WeightPreference.
	StaticWeightStrategy = "StaticWeight"
	// DynamicWeightStrategy indicates dividing replicas by dynamic weight according to WeightPreference.
	DynamicWeightStrategy = "DynamicWeight"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ScheduleAlgorithm

type ScheduleAlgorithm interface {
	Schedule(context.Context, *policyv1alpha1.Placement, *workv1alpha2.ResourceBindingSpec, *ScheduleAlgorithmOption) (scheduleResult ScheduleResult, err error)
}

ScheduleAlgorithm is the interface that should be implemented to schedule a resource to the target clusters.

func NewGenericScheduler

func NewGenericScheduler(
	schedCache cache.Cache,
	registry runtime.Registry,
) (ScheduleAlgorithm, error)

NewGenericScheduler creates a genericScheduler object.

type ScheduleAlgorithmOption added in v1.3.0

type ScheduleAlgorithmOption struct {
	EnableEmptyWorkloadPropagation bool
}

ScheduleAlgorithmOption represents the option for ScheduleAlgorithm.

type ScheduleResult

type ScheduleResult struct {
	SuggestedClusters []workv1alpha2.TargetCluster
}

ScheduleResult includes the clusters selected.

type TargetClustersList added in v0.7.0

type TargetClustersList []workv1alpha2.TargetCluster

TargetClustersList is a slice of TargetCluster that implements sort.Interface to sort by Value.

func (TargetClustersList) Len added in v0.7.0

func (a TargetClustersList) Len() int

func (TargetClustersList) Less added in v0.7.0

func (a TargetClustersList) Less(i, j int) bool

func (TargetClustersList) Swap added in v0.7.0

func (a TargetClustersList) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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