Skip to content

Link all default IP Pools to VPC's internet gateway on creation#10144

Merged
bnaecker merged 5 commits intomainfrom
ben/link-all-default-pools-to-default-internet-gateway
Mar 26, 2026
Merged

Link all default IP Pools to VPC's internet gateway on creation#10144
bnaecker merged 5 commits intomainfrom
ben/link-all-default-pools-to-default-internet-gateway

Conversation

@bnaecker
Copy link
Collaborator

- Remove the footgunny method for fetching "the" default IP Pool for a
  silo, which is hard to use correctly without specifying an IP version.
  Also fix call sites.
- Add method for returning all the default IP Pools for a Silo, of which
  there are at most 2.
- In the VPC creation saga, ensure that we create an internet gateway
  pool for all the IP Pools currently linked to the silo as a default.
- Add a data migration that renames any existing "default" gateway IP
  Pools as "default-v4" or "default-v6", as we're now specifying the
  version.
- Add regression test for #10117.
- This fixes #10117.
@bnaecker bnaecker force-pushed the ben/link-all-default-pools-to-default-internet-gateway branch from 34a886b to 26086b6 Compare March 24, 2026 21:53
Copy link
Contributor

@FelixMcFelix FelixMcFelix left a comment

Choose a reason for hiding this comment

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

One optional nit but I think this looks good. Thanks for putting this together quickly Ben.

@bnaecker bnaecker enabled auto-merge (squash) March 25, 2026 19:06
Copy link
Contributor

@jgallagher jgallagher left a comment

Choose a reason for hiding this comment

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

LGTM, just a questions.


UPDATE omicron.public.internet_gateway_ip_pool AS igw_pool
SET
name = 'default-' || ip_pool.ip_version::STRING,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could someone have manually created pools named default-v4 or default-v6?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I think that could happen. I waffled on this honestly, because there is no unique index on the name, nor do we ever really look for the name at all AFAICT. I only thought it would be confusing to have two pools named the same thing, that only differed in the version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do you think it's better to avoid the migration entirely, given this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure! Do we have deployed systems that already have default pools? If so, are those names both named default unless someone has explicitly changed them?

My gut feeling is default-v4 + default-v6 is clearer than default + default. I'm just a little sketchy on unconditionally renaming a thing that an operator might have already named (or renamed?) themselves, or renaming things in a way that might collide with other pools that already exist. Sorry, I'm not sure I'm being helpful at all - might be worth asking somewhat more broadly, if this is worth getting consensus on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, I get it. I think there are a few parts:

  • There's no unique index on the name, so while having duplicates is probably confusing, it won't cause hard errors
  • It's possible that someone created a gateway IP pool with the name "default-v{4,6}", but not renamed this default to that. We don't have an update endpoint for this type.

I'm happy to get more feedback, but my sense is this is an improvement and unlikely to break things.

- simpler ordering
- Add error message if no default pools on VPC creation
- fix mismerge with main
@bnaecker bnaecker merged commit d7ebf7f into main Mar 26, 2026
16 checks passed
@bnaecker bnaecker deleted the ben/link-all-default-pools-to-default-internet-gateway branch March 26, 2026 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Newly created VPC does not have IP pool attached to internet gateway

3 participants