Skip to content
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

Introduce resource conflict resolution strategy to PropagationPolicy #3444

Closed
yizhang-zen opened this issue Apr 21, 2023 · 5 comments
Closed
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@yizhang-zen
Copy link
Contributor

What would you like to be added:
/kind api-change
/kind feature

Similar to karmadactl promote function, make PropagationPolicy to be able to propagate resources to member clusters where the resources exist, by annotating work.karmada.io/conflict-resolution=overwrite

Why is this needed:
To provide the ability to overwrite resources that already exist in the member cluster instead of failure when creating PropagatePolicy.

Use case 1:
When doing Blue/Green migration, the resources that wait to be migrated may already exist in the green cluster. Using overwrite strategy to avoid potential failures and make sure the resources get updated to be consistent with resources in original blue cluster.

Use case 2:
When failover, after promoting resources from legacy clusters, Karmada will be able to propagate resources to backup clusters and overwrite resources. This will make Karmada as single source of truth, but we can get it work with clusterAffinity and clusterTolerations to decide which resources can live as they are or get overwritten in which member clusters.

@yizhang-zen yizhang-zen added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 21, 2023
@karmada-bot karmada-bot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Apr 21, 2023
@Poor12
Copy link
Member

Poor12 commented Apr 21, 2023

I think it's useful to provide some update strategies to PropagationPolicy which could reduce user focus on internal objects.

@RainbowMango
Copy link
Member

I might need to ask a few questions to understand the use cases.

When doing Blue/Green migration, the resources that wait to be migrated may already exist in the green cluster.

I guess the Blue/Green migration means migrating resources from blue cluster to green cluster. But why do the resources already exist in the green cluster? In addition, I'm curious about the Blue/Green migration thing, why do you need to do the migration?

but we can get it work with clusterAffinity and clusterTolerations to decide which resources can live as they are or get overwritten in which member clusters.

Do you mean the workaround without the requesting feature?

@yizhang-zen
Copy link
Contributor Author

Yes, the B/G migration means migrating all existing workload from Blue cluster to Green cluster. In our case, the blue clusters are built using some customized tools, while green clusters are EKS ones. This migration will help us get rid of the old infra and move to AWS managed k8s cluster.

But why do the resources already exist in the green cluster?

That is because our migration strategy. Some of the critical services will be dump to Green cluster before the migration and they will be the dependencies that propagates by other application.

Do you mean the workaround without the requesting feature?

well..i was trying to say after the feature in place, it will work with other pp strategies to bring more flexibility.

@RainbowMango RainbowMango added this to the v1.6 milestone May 4, 2023
@RainbowMango
Copy link
Member

Thanks. It makes sense to me.

make PropagationPolicy to be able to propagate resources to member clusters where the resources exist, by annotating work.karmada.io/conflict-resolution=overwrite

I guess we might need to extend the PropagationPolicy(and ResourceBind as well) by adding a new field to specify the behavior. Am I right? Do you have any ideas on this API change?

@RainbowMango RainbowMango modified the milestones: v1.6, v1.7 May 29, 2023
@yizhang-zen
Copy link
Contributor Author

Closed in favor of #3780 🙇‍♀️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants