-
Notifications
You must be signed in to change notification settings - Fork 981
Open
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Milestone
Description
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
karmada/pkg/scheduler/scheduler.go
Lines 393 to 401 in 006cf70
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
orkarmadactl version
): v1.4.1 - kubernetes: 1.20.10
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.
Type
Projects
Status
No status