MultiCluster Failover with ClusterAffinities Not Functioning well with WorkloadRebalancer #7707
Unanswered
surenthar-rajamohan-work
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
As mentioned here: #4990 by @RainbowMango
Good day, I saw that the previous related issue was closed with this comment:
However, I would like to raise a concern because the behavior I am seeing still does not seem to match what is described in the documentation for
clusterAffinities, especially for the disaster recovery use case.I am referring to this documentation:
https://karmada.io/docs/userguide/scheduling/propagation-policy/#use-case-2-disaster-recovery-primary-and-backup-clusters
Based on my understanding, with this configuration:
Karmada should prefer
member-cluster-1first. Ifmember-cluster-1fails or cannot satisfy scheduling, it should move the workload tomember-cluster-2. Aftermember-cluster-1recovers, I expectedWorkloadRebalancerto trigger fresh scheduling and move the workload back tomember-cluster-1, since it is the first affinity group.However, I am seeing different behavior.
After failing over to
member-cluster-2, I removed all taints from both clusters and confirmed thatmember-cluster-1is healthy:Then I applied a
WorkloadRebalancerusing the correct Deployment name. TheWorkloadRebalancercompleted successfully:The
ResourceBindingalso shows that rescheduling was triggered:However, after the successful rebalance, the workload still remained on the backup cluster:
The
ResourceBindingevent also shows:So the rebalancer seems to work, but the scheduler still selects
member-cluster-2even thoughmember-cluster-1is listed first inclusterAffinities, isReady=True, and has no taints.My Deployment PropagationPolicy:
My WorkloadRebalancer:
My prerequisite PropagationPolicy, which keeps the prerequisites in both clusters:
The current
ResourceBindingfor the Deployment shows this:The event confirms the final scheduling result:
My question is:
Is this expected behavior for
clusterAffinities?Specifically, after the primary cluster recovers and
WorkloadRebalancersuccessfully triggers rescheduling, should the workload move back to the first matching affinity group,primary-cluster, or isclusterAffinitiesonly used for fallback during failure and not for automatic/manual failback?If the documented disaster recovery example requires additional configuration to support failback to the primary cluster, could you please clarify what is missing from my configuration?
Additional version information:
I also checked the running Karmada component versions and confirmed that this does not seem to be an unsupported-field issue.
The scheduler reports:
The controller-manager reports:
The webhook reports:
The API also exposes
overflowAffinities:So the cluster appears to be running a build newer than
v1.18.0, and the CRD/API supports the newer affinity fields. However,WorkloadRebalancerstill does not move the workload back to the first affinity group after the primary cluster becomes healthy again.All reactions