Open whitewindmills opened 3 weeks ago
If the weights are set to the same, I understand that's the effect.
I understand that sometimes the number of replicas is not divisible by the number of clusters. In this case, there must be some clusters with one more replica.
In this case, there must be some clusters with one more replica.
For general scenarios, we can only achieve the maximum approximate average assignment. This is an unchangeable fact.
How about describing it in detail at a community meeting?
cc @RainbowMango
Given the plausibility of this feature, and the fact that the difficulty of implementing it is not very complicated, how about we do this requirement as an OSPP project @RainbowMango @whitewindmills
if user specified it the strategy, will it ignore the result of score
step?
if user specified it the strategy, will it ignore the result of score step?
@Vacant2333 Great to hear your thoughts. I don't think this strategy has something to do with cluster scores. Cluster scores only are used to select clusters based on the cluster spread constraint.
hello, i wonder know that when will be different with when we use AverageReplicas
, at my understanding, static weight assignment will consider the cluster can create so many replicas, but AverageReplcias
will just assign the replicas, any other situation will cause different schdule result?
(( thanks for your answer @whitewindmills
apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
name: nginx-propagation
spec:
#...
placement:
replicaScheduling:
replicaDivisionPreference: Weighted
replicaSchedulingType: Divided
weightPreference:
staticWeightList:
- targetCluster:
clusterNames:
- member1
weight: 1
- targetCluster:
clusterNames:
- member2
weight: 1
@Vacant2333
Whether it's the static weight strategy or this AverageReplicas
strategy, they're just a way of assigning replicas. At present, the static weights strategy mainly have the following two ”disadvantages“:
Hope it helps you.
@whitewindmills i got it, if this feat is not add to OSPP, i would like to implement it~~ im watch on karmada-scheduler for now
Hi @Vacant2333 We are going to add this task to the OSPP 2024. You can join in the discussion and review.
What would you like to be added:
Background
We want to introduce a new replica assignment strategy in the scheduler, which supports an even assignment of the target replicas across the currently selected clusters.
Explanation
After going through the filtering, prioritization, and selection phases, three clusters(
member1
,member2
,member3
) were selected. We will automatically assign 9 replicas equally among these three clusters, the result we expect is[{member1: 3}, {member2: 3}, {member3: 3}]
.Why is this needed:
User Story
As a developer, we have a deployment with 2 replicas that needs to be deployed with high availability across AZs. We hope Karmada can schedule it to two AZs and ensure that there is a replica on each AZ.
Our PropagationPolicy might look like this:
But unfortunately, the strategy
AvailableReplicas
does not guarantee that our replicas are evenly assigned.Any ideas?
We can introduce a new replica assignment strategy like
AvailableReplicas
, maybe we can name itAverageReplicas
. It is essentially different from static weight assignment, because it does not support spread constraints and is mandatory. When assigning replicas, it does not consider whether the cluster can place so many replicas.