-
Notifications
You must be signed in to change notification settings - Fork 62
Add operator APIs for manipulating system IP Pools #9225
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
base: main
Are you sure you want to change the base?
Conversation
4a65598 to
eed8606
Compare
- Add Nexus endpoints for reserving IP Pools for Oxide use or for external customer Silos - Remove check used to hide internal IP Pools, since they're all visible to an operator now - Rename operator IP Pool endpoints by prefixing `system_*`, to avoid conflicts with previous "silo-scoped" endpoints. - Handle possibility of any number of Oxide-internal IP Pools in various places where we previously assumed exactly 2 of them. - Fixes #8947 - Fixes #8226
eed8606 to
143f98a
Compare
|
We should probably hold this PR until after we cut the R17 release. I'm also adding a PR to the CLI repo handling these breaking changes. |
rcgoodfellow
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.
Thanks @bnaecker! Comments follow.
|
Thanks for y'all's patience. Now that R17 is out, this is ready for a proper review. |
| ) -> Result<HttpResponseOk<views::IpPoolSiloLink>, HttpError>; | ||
|
|
||
| /// Fetch Oxide service IP pool | ||
| /// Reserve an IP Pool for use by specific 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.
I don't understand this comment, but I also don't understand networking beyond what you told me about it being like a series of tubes.
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.
On second thought I think I understand this better. "Reserve" is a funny verb. I think we're saying "should we use this IP pool for like normal silo shit or should we use it for system services"
I imagine we considered using "link" to a "thing that takes the place of a silo" but it was too confusing because e.g. in general an ip pool can be "linked" to multiple silos, but can only be "reserved" as a (the?) system silo exclusive to use with silos.
| // is_default } | ||
| ) -> Result<HttpResponseOk<ResultsPage<views::IpPoolSiloLink>>, HttpError>; | ||
|
|
||
| /// Link IP pool to silo |
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.
I find this to be confusing. I think the idea is that there are IP Pools and Silos; a "link" is an association between them. I could ask "for this silo, show me the linked ip pools" or "for this ip pool, show me the linked silos"
I'm suggesting this as alternative text to the text below that I can't comment on due to github
Linking an IP pool and a silo allows users within that silo to allocate IP addresses from that IP pool and assign them to instances. When linking an IP pool, one can designated that pool as the "default" for the silo. When a user of that silo allocates an IP address without specifying a pool, IP addresses are allocated from that default pool. A silo can have a most one default poo.
And I think we should say the following, but I'm not sure it's correct:
If there is no default pool, requests that allocate IP addresses must specify a particular pool (linked to that silo). Specifying that a linked IP pool should be the default replaces the existing default (if there is one). To modify a silo's default IP pool, use the update operation. [a bit oblique, but trying to make it agnostic between the CLI and API]
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.
Do we also need to explain how this can only be used for IP pools that are "reserved" for instances?
| tags = ["system/ip-pools"], | ||
| }] | ||
| async fn ip_pool_silo_update( | ||
| async fn system_ip_pool_silo_update( |
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.
I think the docs above could be improved
Modify whether a linked IP pool is the default for a silo.
| ) -> Result<HttpResponseOk<views::IpPool>, HttpError>; | ||
| ) -> Result<HttpResponseOk<views::SystemIpPool>, HttpError>; | ||
|
|
||
| /// Fetch IP pool utilization |
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.
| /// Fetch IP pool utilization | |
| /// View IP pool utilization |
Enh.. we're about 60/40 fetch vs. view so whatever...
| #[derive(Clone, Copy, Debug, Deserialize, JsonSchema, PartialEq, Serialize)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub enum IpPoolReservationType { | ||
| /// The pool is reserved for use by external customer Silos. |
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.
External to what? Customer? This comment appears in the OpenAPI document; I think we should write it as external docs
| } | ||
| } | ||
|
|
||
| /// Indicates what resources an IP Pool is reserved for. |
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.
| /// Indicates what resources an IP Pool is reserved for. | |
| /// IP Pool designation as either for Instances or System Services |
| pub ip_version: IpVersion, | ||
| /// Type of IP pool (unicast or multicast) | ||
| pub pool_type: shared::IpPoolType, | ||
| /// Resources the IP Pool is reserved for. |
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 seems like an odd use of the term "reserve"
| /// Which resources the IP Pool is reserved for. | ||
| /// | ||
| /// The default is reserved for external silos. | ||
| #[serde(default = "IpPoolReservationType::external_silos")] | ||
| pub reservation_type: IpPoolReservationType, |
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.
do we expect people to change ip pools from one type to another?
system_*, to avoid conflicts with previous "silo-scoped" endpoints.project_ip_pool_listandproject_ip_pool_view#8226