Skip to content

Assign 0 replicas #6202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
LavredisG opened this issue Mar 13, 2025 · 4 comments
Open

Assign 0 replicas #6202

LavredisG opened this issue Mar 13, 2025 · 4 comments
Labels
kind/question Indicates an issue that is a support question.

Comments

@LavredisG
Copy link
Contributor

Is there a way to create a PropagationPolicy in a way that assigns 0 replicas to a cluster?
For example if I have 3 replicas and 3 clusters, I would like to set:
cluster1.staticWeight: 3
cluster2.staticWeight: 0
cluster3.staticWeight: 0

but that isn't feasible because a weight of 0 is not valid.

Is there a valid way that makes it work? A workaround would maybe be to delete the cluster affinity of these clusters that are assigned a weight of 0, but I am curious if there is a more straightforward way to do that.

@LavredisG LavredisG added the kind/question Indicates an issue that is a support question. label Mar 13, 2025
@RainbowMango
Copy link
Member

Before answering your question, may I ask the user case under this?

@LavredisG
Copy link
Contributor Author

Yes ofc. Instead of the the default karmada scheduler I use a custom plugin that after scoring a few possible distributions of replicas, it assigns the best one. So if I want for example to propagate 3 replicas, and I find out that the best scoring distribution is (2,1,0), I would like to set staticWeights to 2:1:0 among the clusters, but that doesn't work due to the last score being 0.

@RainbowMango
Copy link
Member

Sorry I didn't make it clear, I want to know the real world use case, like what kind of workloads and why you need to split the replicas at that weight.

@LavredisG
Copy link
Contributor Author

It's not a "real world" use case, it's for academic project. Essentialy the custom plugin will evaluate a Deployment's possible distributions (input) and after scoring them will choose the best (output) according to our criteria (e.g. power, costs etc). So there happens to be cases where the best distribution has 0 replicas on a cluster.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/question Indicates an issue that is a support question.
Projects
None yet
Development

No branches or pull requests

2 participants