Skip to content

fix(gcp): give every data center its own DNS records - #628

Merged
NJona merged 5 commits into
mainfrom
multi-dc-06-per-datacenter-dns
Sep 22, 2026
Merged

NJona merged 5 commits into
mainfrom
multi-dc-06-per-datacenter-dns

Conversation

@NJona

@NJona NJona commented Jul 31, 2026

Copy link
Copy Markdown
Member

Workspaces resolve per data center, and so does the platform: the frontend asks <dc-id>.<codesphere.domain> for the configuration of the data center a workspace lives in. OMS only created cs.<base-domain> and its wildcard, both pointing at the first data center's gateway, so with more than one data center the second one's endpoint resolved to the first's gateway, which has no route for that host. Every browser request for it was reset — and since the frontend fetches that config before rendering anything, the whole UI failed.

EnsureDNSRecords now creates, per data center, its workspace hosting names and SSH proxy name pointing at its own public gateway and SSH proxy, plus <dc-id>.cs.<base-domain> and its wildcard pointing at its own platform gateway.

Review notes

  • The per-data-center platform names are only created when there is more than one data center: a single one is the primary, which cs.<base-domain> already resolves to. So single-DC bootstraps still create exactly the same five records.
  • The created records are recorded in the infra file so cleanup deletes exactly those. DeleteDNSRecordSets therefore takes the record list instead of a base domain; cleanup falls back to deriving the names for older infra files and for a cleanup driven only by --project-id.
  • Verified against a live two-data-center instance: adding these two records was what made the second data center reachable.

Part of the oms beta bootstrap-gcp --multi-dc stack (10 PRs). Merge in order; each PR is based on its predecessor.

@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from 875fe8d to 80ef9f8 Compare August 4, 2026 08:12
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from 80ef9f8 to d1de6c9 Compare August 5, 2026 15:48
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from d1de6c9 to ab1e4fe Compare August 7, 2026 16:03
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from ab1e4fe to 9d2936f Compare August 10, 2026 14:17
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch 2 times, most recently from 40d9c77 to 1aac951 Compare August 12, 2026 09:16
@NJona
NJona requested a review from NautiluX August 12, 2026 11:17
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from 1aac951 to 5293739 Compare August 13, 2026 12:48
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from 2afb857 to 14f63ad Compare August 14, 2026 07:01
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from 14f63ad to e2987cf Compare August 14, 2026 07:15
@NJona
NJona requested a review from joka134 August 14, 2026 07:56
Base automatically changed from multi-dc-05-per-datacenter-infra to main September 10, 2026 09:05
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch 2 times, most recently from 4923161 to 02b546a Compare September 11, 2026 06:32
@NJona
NJona requested review from joka134 and removed request for joka134 September 11, 2026 06:59
Comment thread push-multi-dc-stack.sh Outdated
Comment thread internal/bootstrap/gcp/gcp.go
NJona added a commit that referenced this pull request Sep 16, 2026
…ript

Review feedback on #628: the DNS record helpers, EnsureDNSRecords, ensureDnsPermissions
and dnsARecord now live in their own file in the gcp package, with the standalone
DataCenterDNSRecordNames test next to them. push-multi-dc-stack.sh is a local helper that
was committed by accident.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
NJona added a commit that referenced this pull request Sep 16, 2026
…ript

Review feedback on #628: the DNS record helpers, EnsureDNSRecords, ensureDnsPermissions
and dnsARecord now live in their own file in the gcp package, with the standalone
DataCenterDNSRecordNames test next to them. push-multi-dc-stack.sh is a local helper that
was committed by accident.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from b2709cb to fba8a82 Compare September 16, 2026 13:52
@NJona
NJona requested a review from joka134 September 16, 2026 14:14
NJona added a commit that referenced this pull request Sep 16, 2026
…ript

Review feedback on #628: the DNS record helpers, EnsureDNSRecords, ensureDnsPermissions
and dnsARecord now live in their own file in the gcp package, with the standalone
DataCenterDNSRecordNames test next to them. push-multi-dc-stack.sh is a local helper that
was committed by accident.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from fba8a82 to ba34fa8 Compare September 16, 2026 14:20

@joka134 joka134 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚀 🚀 🚀

NJona and others added 4 commits September 21, 2026 16:43
Workspaces resolve per data center, and so does the platform: the
frontend asks <dc-id>.<codesphere.domain> for the configuration of the
data center a workspace lives in. OMS only created cs.<base-domain> and
its wildcard, both pointing at the first data center's gateway, so with
more than one data center the second one's endpoint resolved to the
first's gateway, which has no route for that host — every browser
request for it was reset, and since the frontend fetches that config
before rendering, the whole UI failed.

EnsureDNSRecords now creates, per data center, its workspace hosting
names and SSH proxy name pointing at its own public gateway and SSH
proxy, plus <dc-id>.cs.<base-domain> and its wildcard pointing at its
own platform gateway. The per-data-center platform names are only
created when there is more than one data center: a single one is the
primary, which cs.<base-domain> already resolves to.

The records that were created are recorded in the infra file, so cleanup
deletes exactly those. DeleteDNSRecordSets therefore takes the record
list instead of a base domain, and cleanup falls back to deriving the
names for infra files written before this and for a cleanup driven only
by --project-id.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
Signed-off-by: NJona <25478046+NJona@users.noreply.github.com>
…ript

Review feedback on #628: the DNS record helpers, EnsureDNSRecords, ensureDnsPermissions
and dnsARecord now live in their own file in the gcp package, with the standalone
DataCenterDNSRecordNames test next to them. push-multi-dc-stack.sh is a local helper that
was committed by accident.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
Rename ensureDnsPermissions to ensureDNSPermissions and document EnsureDNSRecords; moving them
into dns.go put them in the linter's changed-files scope.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
@NJona
NJona force-pushed the multi-dc-06-per-datacenter-dns branch from ba34fa8 to 14a9013 Compare September 22, 2026 06:18
Signed-off-by: NJona <25478046+NJona@users.noreply.github.com>
@NJona
NJona merged commit 924729c into main Sep 22, 2026
7 of 8 checks passed
@NJona
NJona deleted the multi-dc-06-per-datacenter-dns branch September 22, 2026 07:35
DerBurri pushed a commit that referenced this pull request Sep 23, 2026
Workspaces resolve per data center, and so does the platform: the
frontend asks `<dc-id>.<codesphere.domain>` for the configuration of the
data center a workspace lives in. OMS only created `cs.<base-domain>`
and its wildcard, both pointing at the first data center's gateway, so
with more than one data center the second one's endpoint resolved to the
first's gateway, which has no route for that host. Every browser request
for it was reset — and since the frontend fetches that config before
rendering anything, the whole UI failed.

`EnsureDNSRecords` now creates, per data center, its workspace hosting
names and SSH proxy name pointing at its own public gateway and SSH
proxy, plus `<dc-id>.cs.<base-domain>` and its wildcard pointing at its
own **platform** gateway.

## Review notes

- The per-data-center platform names are only created when there is more
than one data center: a single one *is* the primary, which
`cs.<base-domain>` already resolves to. So single-DC bootstraps still
create exactly the same five records.
- The created records are recorded in the infra file so cleanup deletes
exactly those. `DeleteDNSRecordSets` therefore takes the record list
instead of a base domain; cleanup falls back to deriving the names for
older infra files and for a cleanup driven only by `--project-id`.
- Verified against a live two-data-center instance: adding these two
records was what made the second data center reachable.
---

Part of the `oms beta bootstrap-gcp --multi-dc` stack (10 PRs). Merge in
order; each PR is based on its predecessor.

---------

Signed-off-by: Jona Neef <Jona.Neef.97@gmail.com>
Signed-off-by: NJona <25478046+NJona@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants