Skip to content

When joining new member cluster, the karmada-scheduler will reschedule some rbs even if their replicas is 0 #6156

Open
@LivingCcj

Description

@LivingCcj

What happened:

when joining a new member cluster, karmada-schduler will reschedule some resourcebindings(rb). Even if the replica of rb is 0 and point to workload, karmada-scheudler will binding the new member to rb and karmada-controller-manager will create the work and workload.

here is the relevant code

if rb.Spec.Replicas == 0 ||
rb.Spec.Placement.ReplicaSchedulingType() == policyv1alpha1.ReplicaSchedulingTypeDuplicated {
// Duplicated resources should always be scheduled. Note: non-workload is considered as duplicated
// even if scheduling type is divided.
klog.V(3).Infof("Start to schedule ResourceBinding(%s/%s) as scheduling type is duplicated", namespace, name)
err = s.scheduleResourceBinding(rb)
metrics.BindingSchedule(string(ReconcileSchedule), utilmetrics.DurationInSeconds(start), err)
return err
}

What you expected to happen:
If the replica of rb is 0 and point to workload , karmada-scehduler should ignore to reschedule these rbs.

Anything else we need to know?:
the replicaSchedulingType of their PropagationPolicy is Divided

apiVersion: policy.karmada.io/v1alpha1
kind: PropagationPolicy
metadata:
  name: test-pp
  namespace: test
spec:
  conflictResolution: Abort
  placement:
    clusterAffinity:
      labelSelector:
        matchExpressions:
        - key: zone
          operator: In
          values:
          - test001
    replicaScheduling:
      replicaDivisionPreference: Weighted
      replicaSchedulingType: Divided
      weightPreference:
        dynamicWeight: AvailableReplicas
  preemption: Never
  priority: 0
  propagateDeps: true
  resourceSelectors:
  - apiVersion: apps/v1
    kind: Deployment
    name: test-pp
    namespace: test
  schedulerName: default-scheduler

Environment:

  • Karmada version: 1.9.1
  • kubectl-karmada or karmadactl version (the result of kubectl-karmada version or karmadactl version): v1.4.1
  • kubernetes: 1.20.10

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions