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

docs(proposal): Migration Rollback Protection #5101

Conversation

CharlesQQ
Copy link
Contributor

@CharlesQQ CharlesQQ commented Jun 26, 2024

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:
part of #4709

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 26, 2024
@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch from 7d688b9 to 09ad847 Compare June 26, 2024 03:55
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.85%. Comparing base (721107d) to head (fb99665).
Report is 8 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5101      +/-   ##
==========================================
- Coverage   34.87%   34.85%   -0.03%     
==========================================
  Files         645      645              
  Lines       44833    44861      +28     
==========================================
- Hits        15637    15635       -2     
- Misses      27991    28021      +30     
  Partials     1205     1205              
Flag Coverage Δ
unittests 34.85% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @CharlesQQ

Hi, guys @RainbowMango @chaunceyjiang @whitewindmills @zhy76 @buji-code @lcw2
We can discuss here to improve the resource deletion policy.

@whitewindmills
Copy link
Member

/assign

@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch 2 times, most recently from 0f2fb08 to 2653e9d Compare June 27, 2024 08:10
Copy link
Member

@whitewindmills whitewindmills left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this annotation have a knock-on effect on dependent resources?―that is, one adds such an annotation to his Deployment, will the annotation affect its dependent resources(like ConfigMap)?

@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch from 2653e9d to 09c6d78 Compare June 28, 2024 03:08
@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch from 09c6d78 to 281dbbf Compare July 1, 2024 03:16
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2024
@CharlesQQ CharlesQQ changed the title docs(proposal): add docs for deletion policy docs(proposal): add docs for using cascading deletion Jul 8, 2024
@karmada-bot karmada-bot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jul 8, 2024
@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch from b9171d6 to 4ad9a83 Compare July 8, 2024 07:48
@karmada-bot karmada-bot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Jul 8, 2024
@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch 2 times, most recently from 5315523 to fe04cdf Compare July 11, 2024 10:12
docs/proposals/use-cascading-deletion/README.md Outdated Show resolved Hide resolved
docs/proposals/use-cascading-deletion/README.md Outdated Show resolved Hide resolved
docs/proposals/use-cascading-deletion/README.md Outdated Show resolved Hide resolved
docs/proposals/use-cascading-deletion/README.md Outdated Show resolved Hide resolved
docs/proposals/use-cascading-deletion/README.md Outdated Show resolved Hide resolved
@CharlesQQ
Copy link
Contributor Author

CharlesQQ commented Sep 4, 2024

I see, what do the author @CharlesQQ thinik of #5101 (comment)?

Extended by Annotation or Extend the fields of Work Choose one, I'm more tend to solution 1.

@chaosi-zju
Copy link
Member

I see, what do the author @CharlesQQ thinik of #5101 (comment)?

Extended by Annotation or Extend the fields of Work Choose one, I'm more tend to solution 1.

got it, solution 1(+1)


Solution One:
Disadvantages:
- When the `execution-controller` determines whether to cascade delete resources in the member clusters, it needs to parse the resources in the Work template from the manifest, which adds an extra parsing overhead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, during the process of deleting the workload, the execution-controller unmarshals the manifest already, does this approach adds extra overhead?

func (c *Controller) tryDeleteWorkload(ctx context.Context, clusterName string, work *workv1alpha1.Work) error {
for _, manifest := range work.Spec.Workload.Manifests {
workload := &unstructured.Unstructured{}
err := workload.UnmarshalJSON(manifest.Raw)
if err != nil {
klog.Errorf("Failed to unmarshal workload, error is: %v", err)
return err
}
err = c.ObjectWatcher.Delete(ctx, clusterName, workload)
if err != nil {
klog.Errorf("Failed to delete resource in the given member cluster %v, err is %v", clusterName, err)
return err
}
}
return nil
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. For this approach, no extra parsing overhead is required.

@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch 3 times, most recently from 7605dc3 to 914badb Compare September 9, 2024 10:49
@CharlesQQ CharlesQQ force-pushed the prevent-removal-managed-resources-docs branch from 914badb to 5ba79d2 Compare September 18, 2024 10:00
Comment on lines 1 to 20
---
title: Use Cascading Deletion in Karmada

authors:
- "@CharlesQQ"

reviewers:
- "@robot"
- TBD

approvers:
- "@robot"
- TBD

creation-date: 2024-07-01
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
---
title: Use Cascading Deletion in Karmada
authors:
- "@CharlesQQ"
reviewers:
- "@robot"
- TBD
approvers:
- "@robot"
- TBD
creation-date: 2024-07-01
---
title: Use Cascading Deletion in Karmada
authors:
- "@CharlesQQ"
reviewers:
- "@robot"
- TBD
approvers:
- "@robot"
- TBD
creation-date: 2024-07-01
---

Please update the reviewers by adding the guys who reviewed this proposal.

@@ -0,0 +1,388 @@
---
title: Use Cascading Deletion in Karmada
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about naming this feature as Migration Rollback Protection?

Forget cascading to avoid misleading.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the prevent-removal-managed-resources-docs branch 3 times, most recently from c2067b9 to a6086f2 Compare September 23, 2024 13:31
@CharlesQQ CharlesQQ changed the title docs(proposal): add docs for using cascading deletion docs(proposal): Migration Rollback Protection Sep 24, 2024
@XiShanYongYe-Chang
Copy link
Member

cc @RainbowMango
Help take a review again.

Comment on lines 22 to 25
<!--
提供一种联邦资源的删除策略,可供用户选择当删除联邦层工作负载时,是否同步删除成员集群中的工作负载。
此设置在工作负载迁移场景中特别有用,可以确保在不影响成员集群上运行的工作负载的情况下快速执行回滚。
-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all Chinese characters.

Karmada 系统的当前行为是这样的,当用户删除 Karmada 控制面的资源时,会同步删除成员集群中被分发的资源。当在某些场景下,例如工作负载迁移回滚场景,用户希望能够保留成员集群中的工作负载。
-->

The current behavior of the Karmada system is that when a user deletes resources from the Karmada control plane, the distributed resources in the member clusters are also deleted synchronously. However, in certain scenarios, such as workload migration rollout scenarios, users may wish to retain the workloads in the member clusters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The current behavior of the Karmada system is that when a user deletes resources from the Karmada control plane, the distributed resources in the member clusters are also deleted synchronously. However, in certain scenarios, such as workload migration rollout scenarios, users may wish to retain the workloads in the member clusters.
The current behavior of the Karmada system is that when a user deletes resources from the Karmada control plane, the distributed resources in the member clusters are also deleted synchronously. However, in certain scenarios, such as workload migration scenarios, users may wish to retain the workloads in the member clusters.

Signed-off-by: chang.qiangqiang <chang.qiangqiang@immomo.com>
@XiShanYongYe-Chang XiShanYongYe-Chang force-pushed the prevent-removal-managed-resources-docs branch from a6086f2 to fb99665 Compare September 25, 2024 03:02
Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 25, 2024
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 25, 2024
@karmada-bot karmada-bot merged commit eaa3452 into karmada-io:master Sep 25, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants