10000 work's replicas set to 0 while resource template' replicas >0 and rb.spec.cluster is not nil · Issue #6361 · karmada-io/karmada · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

work's replicas set to 0 while resource template' replicas >0 and rb.spec.cluster is not nil #6361

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
CharlesQQ opened this issue May 9, 2025 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@CharlesQQ
Copy link
Member
CharlesQQ commented May 9, 2025

What happened:
To prevent extreme situations, when the number of replias of the resource template is zero in the scheduler, the number of replicas of the member cluster remains unchanged (implemented by a custom scheduler)

The problem is: now when workload.spec.replicas = 0, rb.spec.cluster > 0, the number of member cluster replicas all becomes zero;
Under normal circumstances, the number of member cluster replicas should be consistent with that in rb.spec.cluster, which is obviously not the case here

rb.spec.cluster
Image

work object

Image

Here only resource template replicas's >0, rb.spec.cluster will be merged to workload.

if needReviseReplicas(bindingSpec.Replicas, bindingSpec.Placement) {
if resourceInterpreter.HookEnabled(clonedWorkload.GroupVersionKind(), configv1alpha1.InterpreterOperationReviseReplica) {
clonedWorkload, err = resourceInterpreter.ReviseReplica(clonedWorkload, int64(targetCluster.Replicas))
if err != nil {
klog.Errorf("Failed to revise replica for %s/%s/%s in cluster %s, err is: %v",
workload.GetKind(), workload.GetNamespace(), workload.GetName(), targetCluster.Name, err)
errs = append(errs, err)
continue

func needReviseReplicas(replicas int32, placement *policyv1alpha1.Placement) bool {
return replicas > 0 && placement != nil && placement.ReplicaSchedulingType() == policyv1alpha1.ReplicaSchedulingTypeDivided
}

What you expected to happen:

work object's replias must same as rb.spec.cluster info

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Karmada version:
  • kubectl-karmada or karmadactl version (the result of kubectl-karmada version or karmadactl version):
  • Others:
@CharlesQQ CharlesQQ added the kind/bug Categorizes issue or PR as related to a bug. label May 9, 2025
@RainbowMango
Copy link
Member

To prevent extreme situations, when the number of copies of the resource template is zero in the scheduler, the number of copies of the member cluster remains unchanged (implemented by a custom scheduler)

Does the number of copies mean number of replicas?

@CharlesQQ
Copy link
Member Author

To prevent extreme situations, when the number of copies of the resource template is zero in the scheduler, the number of copies of the member cluster remains unchanged (implemented by a custom scheduler)

Does the number of copies mean number of replicas?

yes, I have modified the description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
Status: No status
Development

No branches or pull requests

2 participants
0