Skip to content

feat: regional API MIG#2490

Merged
jakubno merged 8 commits into
mainfrom
feat/regional-api-mig
Apr 26, 2026
Merged

feat: regional API MIG#2490
jakubno merged 8 commits into
mainfrom
feat/regional-api-mig

Conversation

@jakubno
Copy link
Copy Markdown
Member

@jakubno jakubno commented Apr 23, 2026

  • Add regional instance group for API
  • Drops the datacenters = ["${gcp_zone}"] constraint from the docker-reverse-proxy

jakubno added 5 commits April 23, 2026 18:26
Introduces an `api-cluster` module that provisions the API nodepool as a
regional MIG (BALANCED distribution) in parallel with the existing zonal
`google_compute_instance_group_manager.api_pool`. Load balancer backends are
unchanged and still point at the zonal pool; the regional pool is staged for
a follow-up cutover.

Also drops the `datacenters = ["${gcp_zone}"]` constraint from the
docker-reverse-proxy job so it can schedule on API nodes regardless of zone
once the regional MIG is live.
Backs the four API-facing LB backends (session, api, docker-reverse-proxy,
ingress) with both the zonal and regional instance groups so traffic is
served by both pools during cutover.

Also parameterizes the regional MIG's surge/unavailable counts off the
actual zone count in the region (mirrors the server pool pattern), instead
of hardcoding 3.
@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 23, 2026

PR Summary

Medium Risk
Moderate risk because it introduces a new regional API managed instance group and shifts load balancer backends to serve traffic from two pools, which could affect routing, health checks, and rollout behavior during cutover.

Overview
Adds a new regional API managed instance group via a dedicated nodepool-api Terraform module (instance template, regional MIG, and Nomad health check) and wires it into the cluster so both the existing zonal API pool and the new regional pool are registered as backends for ingress/API/client-proxy/docker-reverse-proxy traffic during migration. It also removes the zone datacenters pin from the docker-reverse-proxy Nomad job and updates startup-script templating paths to reuse the module script.

Reviewed by Cursor Bugbot for commit c7af58a. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread iac/provider-gcp/modules/nodepool-api/main.tf
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Two issues found in the regional API MIG implementation.

Comment thread iac/provider-gcp/nomad-cluster/api-cluster/nodepool.tf Outdated
Comment thread iac/provider-gcp/modules/nodepool-api/main.tf
@jakubno jakubno marked this pull request as ready for review April 24, 2026 06:14
Comment thread iac/provider-gcp/nomad/jobs/docker-reverse-proxy.hcl
@jakubno jakubno assigned sitole and unassigned bchalios Apr 24, 2026
@jakubno jakubno requested review from sitole and removed request for ValentaTomas and dobrac April 24, 2026 06:46
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 875cf02. Configure here.

Comment thread iac/provider-gcp/nomad-cluster/main.tf
Copy link
Copy Markdown
Member

@sitole sitole left a comment

Choose a reason for hiding this comment

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

Lgtm please move api cluster module to be reusable

Comment thread iac/provider-gcp/modules/nodepool-api/main.tf
Match the layout convention used by provider-aws/modules so the API
nodepool module lives alongside its scripts and is reusable across envs
without further state migration.
@jakubno jakubno merged commit 030c6bd into main Apr 26, 2026
45 checks passed
@jakubno jakubno deleted the feat/regional-api-mig branch April 26, 2026 09:51
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.

3 participants