Documentation ¶
Index ¶
- Constants
- func AssignReplicas(clusters []*clusterv1alpha1.Cluster, placement *policyv1alpha1.Placement, ...) ([]workv1alpha2.TargetCluster, error)
- func SelectClusters(clustersScore framework.ClusterScoreList, placement *policyv1alpha1.Placement, ...) ([]*clusterv1alpha1.Cluster, error)
- type ScheduleAlgorithm
- type ScheduleAlgorithmOption
- type ScheduleResult
- type TargetClustersList
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
func SelectClusters(clustersScore framework.ClusterScoreList, placement *policyv1alpha1.Placement, spec *workv1alpha2.ResourceBindingSpec) ([]*clusterv1alpha1.Cluster, error)
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)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.