karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.09k stars 797 forks source link

Confusing schedule result condition #3586

Closed whitewindmills closed 9 months ago

whitewindmills commented 11 months ago

Please provide an in-depth description of the question you have: I'm confused why the ResourceBinding's condition is BindingScheduled when all clusters are filterd by filter plugins.

status:
  conditions:
  - lastTransitionTime: "2023-05-25T09:41:11Z"
    message: Failed to apply all works, see status.aggregatedStatus for details
    reason: FullyAppliedFailed
    status: "False"
    type: FullyApplied
  - lastTransitionTime: "2023-05-25T09:50:37Z"
    message: Binding has been scheduled
    reason: BindingScheduled
    status: "True"
    type: Scheduled
  schedulerObservedGeneration: 2

karmada-scheduler log:

I0525 09:50:37.081526       1 scheduler.go:336] Start to schedule ResourceBinding(default/test-pod) as scheduling type is duplicated
I0525 09:50:37.081536       1 scheduler.go:426] "Begin scheduling resource binding with ClusterAffinity" resourceBinding="default/test-pod"
I0525 09:50:37.081572       1 generic_scheduler.go:150] Cluster "member5715" is not fit, reason: cluster(s) didn't match the placement cluster affinity constraint
I0525 09:50:37.081582       1 scheduler.go:444] ResourceBinding(default/test-pod) scheduled to clusters []
I0525 09:50:37.081694       1 scheduler.go:450] "End scheduling resource binding with ClusterAffinity" resourceBinding="default/test-pod"
I0525 09:50:37.081741       1 scheduler.go:739] Begin to patch status condition to ResourceBinding(default/test-pod)
I0525 09:50:37.081839       1 event.go:294] "Event occurred" object="default/test-pod" fieldPath="" kind="ResourceBinding" apiVersion="work.karmada.io/v1alpha2" type="Warning" reason="ScheduleBindingFailed" message="0/1 clusters are available: 1 cluster(s) didn't match the placement cluster affinity constraint."
I0525 09:50:37.081859       1 event.go:294] "Event occurred" object="default/test" fieldPath="" kind="Pod" apiVersion="v1" type="Warning" reason="ScheduleBindingFailed" message="0/1 clusters are available: 1 cluster(s) didn't match the placement cluster affinity constraint."

Could someone explain to me the reason for this code design? /cc @RainbowMango @XiShanYongYe-Chang @Poor12 @chaunceyjiang image

What do you think about this question?: I think the condition should be BindingFailedScheduling when all clusters are filterd by filter plugins. The code judgment here seems to be redundant. Environment:

RainbowMango commented 10 months ago

Good question. I'll think about it. added this to v1.7 milestone, so that we won't miss it.

whitewindmills commented 10 months ago

Good question. I'll think about it. added this to v1.7 milestone, so that we won't miss it.

We can discuss it at the next meeting.

RainbowMango commented 10 months ago

Sure, that's great, please remember to add an item to the agenda.

RainbowMango commented 10 months ago

I see you put the agenda to Pending topics, I just moved it to Meeting 2023-06-05, please let me know if you can't present this meeting so that we can postpone it.

whitewindmills commented 10 months ago

I'm free to attend the meeting.

whitewindmills commented 10 months ago

/assign

whitewindmills commented 10 months ago

After community discussion, we need to introduce new scheduled condition reasons to explain the status in detail. I'll work on it. /remove-kind question /kind feature