core

package
v1.10.0-preview3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 19 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

func AssignReplicas added in v1.8.0

func AssignReplicas(
	clusters []*clusterv1alpha1.Cluster,
	placement *policyv1alpha1.Placement,
	object *workv1alpha2.ResourceBindingSpec,
) ([]workv1alpha2.TargetCluster, error)

AssignReplicas assigns replicas to clusters based on the placement and resource binding spec.

func SelectClusters added in v1.8.0

SelectClusters selects clusters based on the placement and resource binding spec.

Types

type ScheduleAlgorithm

type ScheduleAlgorithm interface {
	Schedule(context.Context, *workv1alpha2.ResourceBindingSpec, *workv1alpha2.ResourceBindingStatus, *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