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

Change logic of deleting RBS service #2126

Merged
merged 1 commit into from
May 22, 2023

Conversation

panslava
Copy link
Contributor

  • 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

/assign @cezarygerard @aojea

- 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
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 18, 2023
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2023
@@ -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 {
Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor

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

Copy link
Contributor

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)

Copy link
Contributor Author

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

Copy link
Contributor Author

@panslava panslava May 19, 2023

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

Copy link
Member

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

@cezarygerard
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2023
@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [cezarygerard,panslava]

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

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", 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

4 participants