-
Notifications
You must be signed in to change notification settings - Fork 297
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
Change logic of deleting RBS service #2126
Conversation
- Delete only if service has finalizer or rbs forwarding rule, meaning it was provisioned by RBS controller at some point - Don't delete RBS annotation on garbage collection
@@ -621,14 +622,14 @@ func (lc *L4NetLBController) garbageCollectRBSNetLB(key string, svc *v1.Service) | |||
|
|||
// IMPORTANT: Remove LB annotations from the Service LAST, cause changing service fields are emitted as service update to other controllers | |||
if lc.enableDualStack { | |||
if err := deleteL4RBSDualStackAnnotations(lc.ctx, svc); err != nil { |
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.
This is the same error we found yesterday, the last thing to be removed should be the finalizer, also why do we need to remove the annotations if it is going to be deleted?
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.
should not we just delete the finalizer and bail out?
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.
no...
it may well be just migrated to be handled by ILB
so NetLBFinalizerV2 is not needed anymore
but maybe we need to delete the annotations before the finalizer
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.
now I see what is the problem
there may be 404 on updating the annotations on deleted service (finalizer removal triggers deletion)
We should move this annotation removal before the finalizer removal (as it happens in L4 ILB)
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.
Annotation deletion covers the case of garbage collection on switching service types (to clusterIP or ILB), when service not really completely deleted
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.
But we should not remove RBS annotation (as it was set up by user) so this PR removes deleting RBS annotation
But we should still remove annotations that we use for storing created resources
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.
switching service types (
ok, but then we should have 2 flows , one for deletion and other for mutation.
The deletion just removes the finalizer
The mutation just removes the annotations added by the controller but keeps the finalizer
IIUIC this still conflates both
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cezarygerard, panslava 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 |
/assign @cezarygerard @aojea