-
Notifications
You must be signed in to change notification settings - Fork 62
Implement ephemeral IPs #1458
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
Merged
Merged
Implement ephemeral IPs #1458
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Updates the current external IP allocation query to handle both floating and ephemeral IPs, by assuming that the whole port range is already reserved for any existing IP address. - Add public datastore methods for creating SNAT and Ephemeral IPs, delegating to private method for the actual query running/handling - Updates sagas to include UUID generation for external IPs as separate steps, for idempotency, and to create Ephemeral IPs if they're requested. Also rework instance creation/migration sagas to select the Ephemeral IP address, if one was requested, or the SNAT if not. - Adds optional restriction of IP Pools to a project. This adds the project ID or name in a bunch of places, and updates the external IP allocation query to only consider pools which are unrestricted, or whose project ID matches the one of the instance we're allocating an IP for. This relies on a new index on the `instance_external_ip` table, which induces an undesirable sorting (by project, not IP), so we add a new sorting criterion to the query. - Adds tests, especially for the external IP table's check constraints which verify integrity of the name / description / instance ID for different kinds of addresses, and for restriction of an IP pool to a project. - Plumb the external IPs up to Nexus's public API, including instance creation and an endpoint for listing external IPs for an instance. - Adds integration tests for assignment of Ephemeral IPs and authz tests for the endpoint(s)
Collaborator
Author
|
Should resolve #1458. There are still some TODOs, which I'll be moving into issues. |
zephraph
reviewed
Jul 18, 2022
smklein
reviewed
Jul 19, 2022
Collaborator
smklein
left a comment
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.
Overall, looks good. Biggest questions relate to undo actions within the sagas.
This was referenced Jul 19, 2022
- More comments and links to issues - Better handling of external IP vs SNAT IPs during instance provision/migrate - Revert bad MAC address
smklein
approved these changes
Jul 20, 2022
Closed
This was referenced Jul 28, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
floating and ephemeral IPs, by assuming that the whole port range is
already reserved for any existing IP address.
delegating to private method for the actual query running/handling
steps, for idempotency, and to create Ephemeral IPs if they're
requested. Also rework instance creation/migration sagas to select the
Ephemeral IP address, if one was requested, or the SNAT if not.
project ID or name in a bunch of places, and updates the external IP
allocation query to only consider pools which are unrestricted, or
whose project ID matches the one of the instance we're allocating an
IP for. This relies on a new index on the
instance_external_iptable, which induces an undesirable sorting (by project, not IP), so
we add a new sorting criterion to the query.
which verify integrity of the name / description / instance ID for
different kinds of addresses, and for restriction of an IP pool to a
project.
creation and an endpoint for listing external IPs for an instance.
for the endpoint(s)