-
Notifications
You must be signed in to change notification settings - Fork 617
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
[occm] remove SGs from non-existent nodes ports on Update #2696
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cc dulek mdbooth |
@@ -63,7 +63,7 @@ func applyNodeSecurityGroupIDForLB(network *gophercloud.ServiceClient, svcConf * | |||
continue | |||
} | |||
|
|||
listOpts := neutronports.ListOpts{DeviceID: serverID} | |||
listOpts := neutronports.ListOpts{} |
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.
IMO this is an expensive request. I wonder if we can do better. The reason why I did it this way is to limit the number of API calls, but now this list might be really big in some deployments.
An alternative could be to make two queries: one that lists by SG and one that list by server ID.
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 will definitely increase the load
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.
an alternative could be another loop where we filter by SGs and update the ports... but it's also some load.
@@ -75,6 +75,23 @@ func applyNodeSecurityGroupIDForLB(network *gophercloud.ServiceClient, svcConf * | |||
continue | |||
} | |||
|
|||
if port.DeviceID != serverID { |
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 we have a check similar to line 101?
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.
Good point. I actually think we can move the new block after L101, which will help to leave the loop earlier if the port isn't part of the LB's subnet.
PR needs rebase. 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-sigs/prow repository. |
This hasn't got any traction, and we even have concerns about it so I'll just close it for now. |
@EmilienM: Closed this PR. In response to this:
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-sigs/prow repository. |
What this PR does / why we need it:
Update
applyNodeSecurityGroupIDForLB()
to also lookup ports that have the SG tag and detach the SG from the portsthat don't belong to the ports of the current list of Nodes.
This will ensure ports are cleaned up if a Node is being removed from a Loadbalancer.
Which issue this PR fixes(if applicable):
fixes #2695
Release note: