-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Force delete lb when deletion_protection is disabled #2172
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
Force delete lb when deletion_protection is disabled #2172
Conversation
Hi @oliviassss. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@oliviassss, how do you set deletion_protection.enable=true for a nlb? alb.ingress.kubernetes.io/load-balancer-attributes is an annotation for ingress (does not support NLB) and not service. Can you shade a light here? |
The deletion protection will be supported for NLB in the upcoming v2.3.0 release (PR #2051). |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the proposed change, I see that if delete protection is not specified via annotation, but set on the NLB out-of-band, controller still force deletes the underlying NLB. This is contrary to the current design where controller doesn't nodify attributes not explicitly specified. This is a corner case, I agree, but lets see if it would make more sense to block the service deletion.
99ee740
to
7b9fe71
Compare
Codecov Report
@@ Coverage Diff @@
## main #2172 +/- ##
==========================================
- Coverage 52.34% 52.24% -0.11%
==========================================
Files 132 132
Lines 7189 7203 +14
==========================================
Hits 3763 3763
- Misses 3137 3151 +14
Partials 289 289
Continue to review full report at Codecov.
|
f6f33da
to
3c6d288
Compare
According to our internal discussion, we will keep the method as it is now, and record this corner case situation in our documentation properly. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kishorj, oliviassss 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 |
…#2172) * force delete lb when deletion_protection is disabled * check deletion_protection for ALB * check deletion_protection in model builder step * add unit test
Issue
#1900
Description
This PR is to handle the deletion_protection.enabled for both ALB and NLB.
deletion_protection.enabled=true
is in the annotation and the customer deletes the load balancer, the controller will return error right away and refuse to reconcile furtherdeletion_protection.enabled=false
, the deployer will call ModifyLoadBalancerAttributes() to disable the deletion_protection, so it can continue to delete the resource.Tests:
deletion_protection.enabled=true
, verified the service controller will return error and stop reconciling.kubectl edit svc/<my-svc> -n <my-namespace>,
to setdeletion_protection.enabled=false
, verified the deployer will disable the deletion_protection and the resource got deleted.deletion_protection.enabled=true
, verified the group controller will return error and stop reconciling.kubectl edit ingress/<my-ingress> -n <my-namespace>,
to setdeletion_protection.enabled=false
, verified the deployer will disable the deletion_protection and the resource got deleted.Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯