Skip to content

Commit 398e5e9

Browse files
committed
Adding maxAvailableComponentSets to estimator interface
Signed-off-by: mszacillo <[email protected]>
1 parent f9cd5c9 commit 398e5e9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/estimator/client/interface.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,21 @@ var (
3434
unschedulableReplicaEstimators = map[string]UnschedulableReplicaEstimator{}
3535
)
3636

37-
// ReplicaEstimator is an estimator which estimates the maximum replicas that can be applied to the target cluster.
37+
// ReplicaEstimator estimates how many replicas a workload can run on each target cluster,
38+
// based on resource availability and node constraints.
3839
type ReplicaEstimator interface {
40+
// MaxAvailableReplicas returns the maximum number of replicas of a single-component workload that each cluster can host.
3941
MaxAvailableReplicas(ctx context.Context, clusters []*clusterv1alpha1.Cluster, replicaRequirements *workv1alpha2.ReplicaRequirements) ([]workv1alpha2.TargetCluster, error)
4042
}
4143

44+
// ComponentSetEstimator extends ReplicaEstimator to handle multi-component workloads,
45+
// where all components in a set must be scheduled together.
46+
type ComponentSetEstimator interface {
47+
ReplicaEstimator
48+
// MaxAvailableComponentSets returns the maximum number of complete multi-component sets (in terms of replicas) that each cluster can host.
49+
MaxAvailableComponentSets(ctx context.Context, clusters []*clusterv1alpha1.Cluster, components []*workv1alpha2.Component) ([]workv1alpha2.TargetCluster, error)
50+
}
51+
4252
// UnschedulableReplicaEstimator is an estimator which estimates the unschedulable replicas which belong to a specified workload.
4353
type UnschedulableReplicaEstimator interface {
4454
GetUnschedulableReplicas(ctx context.Context, clusters []string, reference *workv1alpha2.ObjectReference, unschedulableThreshold time.Duration) ([]workv1alpha2.TargetCluster, error)

0 commit comments

Comments
 (0)