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

KEP: Resource deletion protection proposal #3802

Conversation

Vacant2333
Copy link
Contributor

@Vacant2333 Vacant2333 commented Jul 17, 2023

What type of PR is this?
Add resource deletion protection proposal
Issue: #3728
/kind feature
/kind documentation

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Add resource deletion protection proposal

@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 17, 2023
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 17, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -1.87% ⚠️

Comparison is base (c921acd) 55.68% compared to head (810a674) 53.82%.
Report is 271 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    #3802      +/-   ##
==========================================
- Coverage   55.68%   53.82%   -1.87%     
==========================================
  Files         222      231       +9     
  Lines       21195    23013    +1818     
==========================================
+ Hits        11803    12386     +583     
- Misses       8765     9954    +1189     
- Partials      627      673      +46     
Flag Coverage Δ
unittests 53.82% <ø> (-1.87%) ⬇️

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

see 84 files with indirect coverage changes

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

@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from 4de6e36 to 3936282 Compare July 18, 2023 02:49
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~

docs/proposals/namespace-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/namespace-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/namespace-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/namespace-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/namespace-deletion-protection/README.md Outdated Show resolved Hide resolved
@Vacant2333 Vacant2333 changed the title [WIP] Add namespace deletion protection proposal [WIP] KEP: Namespace deletion protection proposal Jul 18, 2023
@Vacant2333
Copy link
Contributor Author

Vacant2333 commented Jul 26, 2023

Regarding the issue of users force deleting resources, I believe we shouldn't block this operation. Our goal is to prevent users from accidentally deleting resources, but if a user uses the --force parameter, we should assume that they know what they are doing. If anyone has any thoughts on this, please feel free to share them below.
/cc @XiShanYongYe-Chang

@Vacant2333
Copy link
Contributor Author

Regarding the issue of users force deleting resources, I believe we shouldn't block this operation. Our goal is to prevent users from accidentally deleting resources, but if a user uses the --force parameter, we should assume that they know what they are doing. If anyone has any thoughts on this, please feel free to share them below. /cc @XiShanYongYe-Chang

/cc @zishen @RainbowMango

@karmada-bot
Copy link
Collaborator

@Vacant2333: GitHub didn't allow me to request PR reviews from the following users: zishen.

Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

Regarding the issue of users force deleting resources, I believe we shouldn't block this operation. Our goal is to prevent users from accidentally deleting resources, but if a user uses the --force parameter, we should assume that they know what they are doing. If anyone has any thoughts on this, please feel free to share them below. /cc @XiShanYongYe-Chang

/cc @zishen @RainbowMango

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@XiShanYongYe-Chang
Copy link
Member

Regarding the issue of users force deleting resources, I believe we shouldn't block this operation. Our goal is to prevent users from accidentally deleting resources, but if a user uses the --force parameter, we should assume that they know what they are doing. If anyone has any thoughts on this, please feel free to share them below. /cc @XiShanYongYe-Chang

We can add this QA to the proposal.

@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from 9b11d26 to fd5651c Compare July 28, 2023 03:23
@XiShanYongYe-Chang
Copy link
Member

Please sign off refer to https://github.com/karmada-io/karmada/pull/3802/checks?check_run_id=15416905578

Ask an review from @zishen @RainbowMango

@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from fd5651c to 32cea53 Compare July 31, 2023 07:12
@Vacant2333
Copy link
Contributor Author

Our label name may need to be changed. Does anyone have any suggestions?

@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from 32cea53 to 12a5ded Compare August 1, 2023 08:09
@Vacant2333 Vacant2333 changed the title [WIP] KEP: Namespace deletion protection proposal KEP: Namespace deletion protection proposal Aug 1, 2023
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 1, 2023
@RainbowMango
Copy link
Member

After a quick glance at this proposal, a question occurred to me: Will it be convenient enough for users to have only one label? What if users have a large number of namespaces to protect? They might need to add the labels to each of them.
@XiShanYongYe-Chang

@XiShanYongYe-Chang
Copy link
Member

If there are numerous resources that need to be protected, it would be tedious for users to add labels one by one. It would be more convenient if a configurable resource could be provided to inform Karmada which resources need protection.
@RainbowMango

@Vacant2333
Copy link
Contributor Author

If there are numerous resources that need to be protected, it would be tedious for users to add labels one by one. It would be more convenient if a configurable resource could be provided to inform Karmada which resources need protection. @RainbowMango

Wondering whether such implementation would be overly complex, we only need to protect the resources of the control plane, and in most cases, there may not be too many resources that need protection.

@XiShanYongYe-Chang
Copy link
Member

Wondering whether such implementation would be overly complex, we only need to protect the resources of the control plane, and in most cases, there may not be too many resources that need protection.

The deletion protection for individual resources is an atomic capability that we provide. If there are a large number of resources that need to be protected, we may need to consider how to optimize the user experience.

@Vacant2333
Copy link
Contributor Author

Vacant2333 commented Aug 7, 2023

Wondering whether such implementation would be overly complex, we only need to protect the resources of the control plane, and in most cases, there may not be too many resources that need protection.

The deletion protection for individual resources is an atomic capability that we provide. If there are a large number of resources that need to be protected, we may need to consider how to optimize the user experience.

Perhaps we can consider this issue after implementing the proposal?
At the moment, I don't have a good idea to solve this problem.

@XiShanYongYe-Chang
Copy link
Member

Perhaps we can consider this issue after implementing the proposal?
At the moment, I don't have a good idea to solve this problem.

Yes, I agree with your point.
In addition, we need to consider whether the default protection strategy for resources should require users to manually add labels to enable deletion protection, or if it should be automatically enabled once the resource template is created.

@Vacant2333
Copy link
Contributor Author

In addition, we need to consider whether the default protection strategy for resources should require users to manually add labels to enable deletion protection, or if it should be automatically enabled once the resource template is created.

In Kruise, they did not adopt an automatic protection strategy but instead used two levels of protection. However, I believe their approach is not only complex but also has some limitations, and it also involves manually adding labels. I think our practice of manually adding them is sufficient, and adding a default policy may cause inconvenience to the users.

@XiShanYongYe-Chang
Copy link
Member

I think we can add a new featureGate that, when turned on, enables deletion protection for all namespace resources (and extends to other resources as well).
@RainbowMango @Vacant2333

@Vacant2333
Copy link
Contributor Author

This is a good idea, but perhaps users don't want to protect all namespaces by default? Maybe this featureGate could be solely responsible for enabling or disabling deletion protection.

@karmada-bot karmada-bot added the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 11, 2023
@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from 44e5ac4 to 12a5ded Compare August 11, 2023 07:25
@karmada-bot karmada-bot removed the do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. label Aug 11, 2023
@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 Aug 29, 2023
@Vacant2333 Vacant2333 changed the title KEP: Namespace deletion protection proposal KEP: Resource deletion protection proposal Aug 29, 2023
@XiShanYongYe-Chang
Copy link
Member

/assign

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.

Good job! Let's continue to improve this proposal.

docs/proposals/resource-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/resource-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/resource-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/resource-deletion-protection/README.md Outdated Show resolved Hide resolved
docs/proposals/resource-deletion-protection/README.md Outdated Show resolved Hide resolved
@RainbowMango
Copy link
Member

Hi, Please tidy the commits, let's get it ready to move forward.

Signed-off-by: Vacant2333 <vacant2333@gmail.com>
@Vacant2333 Vacant2333 force-pushed the add_namespace_deletion_protection_proposal branch from 9154dbb to 335aab3 Compare September 18, 2023 12:47
@Vacant2333
Copy link
Contributor Author

@kevin-wangzefeng

Hi, Please tidy the commits, let's get it ready to move forward.

~~ok

@XiShanYongYe-Chang
Copy link
Member

/lgtm
I think we can merge it first and then iteratively optimize it.

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2023
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.

/approve

@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 19, 2023
@karmada-bot karmada-bot merged commit 1df8309 into karmada-io:master Sep 19, 2023
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. kind/feature Categorizes issue or PR as related to a new feature. 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.

None yet

6 participants