Skip to content

Title: feat(gce): add regional MIG support for multi-AZ instance groups - #18434

Draft
wasimat404 wants to merge 1 commit into
kubernetes:masterfrom
wasimat404:regional-mig-support
Draft

Title: feat(gce): add regional MIG support for multi-AZ instance groups#18434
wasimat404 wants to merge 1 commit into
kubernetes:masterfrom
wasimat404:regional-mig-support

Conversation

@wasimat404

@wasimat404 wasimat404 commented May 31, 2026

Copy link
Copy Markdown

Note: This PR was developed with AI assistance during code exploration and drafting. I reviewed the code, ran builds and tests locally, and take responsibility for the implementation. Currently being revised based on maintainer feedback ,,,,moved to draft pending design direction.

Fixes #18411

tl;dr

There's been a TODO in AutoscalingGroupModelBuilder since 2017 about switching to Regional MIGs instead of splitting one InstanceGroup into separate per-zone zonal MIGs. The two blockers (no Terraform support, no zone steering) are both resolved now, so this PR does the thing.

what's in here

  • New RegionInstanceGroupManager task — handles GCE API calls + renders as google_compute_region_instance_group_manager in Terraform with distribution_policy_zones
  • New RegionInstanceGroupManagerClient in the compute client layer + mock for tests
  • Build() refactored — when GCERegionalMIG feature flag is on, creates one regional MIG spanning all zones instead of N zonal MIGs
  • Feature flag defaults to off so nothing changes for existing clusters

not breaking anything

Whole thing is behind KOPS_FEATURE_FLAGS=GCERegionalMIG. Flag off = old behavior, zero migration needed.

still todo

  • Unit test for the regional path with flag enabled
  • Would love maintainer input on the backwards compat approach before moving out of draft

@linux-foundation-easycla

linux-foundation-easycla Bot commented May 31, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: wasimat404 / name: Ubuntu (780fc90)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 31, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @wasimat404!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 31, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @wasimat404. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot
k8s-ci-robot requested review from hakman and zetaab May 31, 2026 08:17
@k8s-ci-robot k8s-ci-robot added the area/provider/gcp Issues or PRs related to gcp provider label May 31, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zetaab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wasimat404

Copy link
Copy Markdown
Author

/check-cla

Add support for GCE Regional Managed Instance Groups, allowing a single
autoscaling InstanceGroup to span multiple zones natively instead of
splitting across per-zone zonal MIGs.

Changes:
- Add RegionInstanceGroupManagerClient interface and implementation
  to the GCE compute client
- Add RegionInstanceGroupManager task with GCE API and Terraform
  rendering (google_compute_region_instance_group_manager)
- Add mock client for testing
- Add GCERegionalMIG feature flag (default: false) for backwards
  compatibility with existing zonal MIG clusters
- Refactor AutoscalingGroupModelBuilder.Build() to create a single
  regional MIG with distribution_policy_zones when flag is enabled
- Add NameForRegionInstanceGroupManager naming helper

Resolves: kubernetes#18411
@wasimat404
wasimat404 force-pushed the regional-mig-support branch from c993469 to 780fc90 Compare May 31, 2026 08:38
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 31, 2026
@wasimat404
wasimat404 marked this pull request as draft June 1, 2026 10:36
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/provider/gcp Issues or PRs related to gcp provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for multiAZ GCE Regional Managed Instance Groups

2 participants