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

Cleanup L4 ILB IP Reservation in all cases. #1181

Merged
merged 2 commits into from
Jul 20, 2020

Conversation

prameshj
Copy link
Contributor

This is a follow up to #1179, the previous PR cleaned up the reservation in case of new Forwarding rule creation or on updates. But, reservation also happens during periodic syncs which need to be cleaned up.

/assign @freehan @bowei

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 14, 2020
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 16, 2020
@prameshj
Copy link
Contributor Author

@freehan This is now ready for review.

@@ -261,6 +261,12 @@ func (l *L4) ensureForwardingRule(loadBalancerName, bsLink string, options gce.I
return nil, err
}
klog.V(2).Infof("ensureForwardingRule(%v): reserved IP %q for the forwarding rule", loadBalancerName, ipToUse)
defer func() {
// Now that the controller knows the forwarding rule exists, we can release the address.
Copy link
Contributor

Choose a reason for hiding this comment

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

add a comment to explain: why no need to hold the address after the forwarding rule exists?

Plus, the following logic may also fail right? For instance, the following logic hit a quota limit and failed to create forwarding rule?

So I guess, it should always release the address to avoid leaking address?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes that's correct. I fixed the comment.

Reservation for IP is made for new FR, updated FR and periodic sync.
Cleanup reservation after FR has been ensured in all cases.
@freehan
Copy link
Contributor

freehan commented Jul 20, 2020

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: freehan, prameshj

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 20, 2020
@k8s-ci-robot k8s-ci-robot merged commit c3026d8 into kubernetes:master Jul 20, 2020
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/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants