core

package
v1.10.7 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 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"
)
View Source
const (
	// Steady represents a steady, incremental approach to re-assign replicas
	// across clusters. It aims to maintain the exist replicas distribution as
	// closely as possible, only making minimal adjustments when necessary.
	// It minimizes disruptions and preserves the balance across clusters.
	Steady assignmentMode = "Steady"

	// Fresh means that disregards the previous assignment entirely and
	// seeks to establish an entirely new replica distribution across clusters.
	// It is willing to accept significant changes even if it involves disruption.
	Fresh assignmentMode = "Fresh"
)

Variables

This section is empty.

Functions

func AssignReplicas added in v1.8.0

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