-
Notifications
You must be signed in to change notification settings - Fork 61
BlueprintBuilder: require caller to provide internal DNS subnet #9250
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
Conversation
This is part of #9238: we'd like to pull `BlueprintResourceAllocator`'s weird construction out of `BlueprintBuilder`, and this removes _one_ use of it. When adding an internal DNS zone, the caller must now specify the `DnsSubet` instead of `BlueprintBuilder` choosing internally. To assist with this, adds `BlueprintBuilder::available_internal_dns_subnets()`, which returns an iterator of available subnets. I'm not sure this is the right interface; will leave a comment inline with some other ideas.
| .map(|(_sled_id, resources)| resources.subnet) | ||
| .next() | ||
| .ok_or(Error::RackSubnetUnknownNoSleds)?; | ||
| let rack_subnet = ReservedRackSubnet::from_subnet(any_sled_subnet); |
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 is the part I like the least. Some alternatives I considered:
- Instead of
available_internal_dns_subnets(), provideinternal_dns_subnets_in_use(), and require the caller to do this work and the filtering we do based on it below. This seems the most true to a "dumb builder" pattern, but puts some annoying work on every caller. - Instead of returning an error on line 713, return an empty iterator if we don't have any commissioned sleds.
- A mix of 1 and 2: instead of returning a raw iterator, return an
AvailableInternalDnsSubnetstype that is more like theInternalDnsSubnetAllocatorremoved in this PR: internally it only tracks the "in use" subnets, and requires the caller to pass in a sled subnet (from which we can derive a rack subnet and the set of possible DNS subnets).
Do any of these seem more likely to put us in a better position w.r.t. multirack? (How will internal DNS subnets be configured in multirack?)
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.
The approach you've got here seems fine to me for now!
| .map(|(_sled_id, resources)| resources.subnet) | ||
| .next() | ||
| .ok_or(Error::RackSubnetUnknownNoSleds)?; | ||
| let rack_subnet = ReservedRackSubnet::from_subnet(any_sled_subnet); |
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.
The approach you've got here seems fine to me for now!
…from the parent blueprint (#9291) This is built on top of #9250, and is related to both #9238 and #8949: * Trims down some of the `BlueprintResourceAllocator` internals * Adds an explicit `ExternalIpPolicy` type; today it holds a couple of IP pools and a set of external DNS IPs, but it gives us a cleaner place to integrate all the IP pool work that @bnaecker is doing with Reconfigurator Since we don't actually have external DNS IPs in a policy anywhere, this adds `DataStore::external_dns_external_ips_specified_by_rack_setup()` (which is implemented as "load the current target blueprint and scan it for external DNS zones"; i.e., exactly what the builder was doing before). We should eventually delete this method once it's possible for an operator to reconfigure the external DNS IPs, but this lets the planning input build up the policy as though we already had this information available, more or less. Other than that new method, _almost_ all the changes in this PR are to tests; the non-test changes are pretty minimal.
This is part of #9238: we'd like to pull
BlueprintResourceAllocator's weird construction out ofBlueprintBuilder, and this removes one use of it. When adding an internal DNS zone, the caller must now specify theDnsSubetinstead ofBlueprintBuilderchoosing internally.To assist with this, adds
BlueprintBuilder::available_internal_dns_subnets(), which returns an iterator of available subnets. I'm not sure this is the right interface; will leave a comment inline with some other ideas.