kubernetes/kops · error

instanceGroup %q has multiple subnets

Error message

instanceGroup %q has multiple subnets

What it means

A GCE instance group resolved to zero or multiple subnets, but GCE requires exactly one per instance group (subnets are regional on GCE); the IG's spec.subnets list is inconsistent.

Source

Thrown at pkg/model/gcemodel/autoscalinggroup.go:348

	clusterHasApiServerOnly := false
	for _, ig := range b.InstanceGroups {
		if ig.IsAPIServerOnly() {
			clusterHasApiServerOnly = true
			break
		}
	}

	for _, ig := range b.InstanceGroups {
		subnets, err := b.GatherSubnets(ig)
		if err != nil {
			return err
		}

		// On GCE, instance groups cannot have multiple subnets.
		// Because subnets are regional on GCE, this should not be limiting.
		// (IGs can in theory support multiple zones, but in practice we don't recommend this)
		if len(subnets) != 1 {
			return fmt.Errorf("instanceGroup %q has multiple subnets", ig.Name)
		}
		subnet := subnets[0]

		instanceTemplate, err := b.buildInstanceTemplate(c, ig, subnet)
		if err != nil {
			return err
		}
		c.AddTask(instanceTemplate)

		instanceCountByZone, err := b.splitToZones(ig)
		if err != nil {
			return err
		}

		for zone, targetSize := range instanceCountByZone {
			name := gce.NameForInstanceGroupManager(b.Cluster.ObjectMeta.Name, ig.ObjectMeta.Name, zone)

			t := &gcetasks.InstanceGroupManager{

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Assign exactly one subnet per GCE instance group
  2. Check subnet names in instance group specs against the cluster's subnet definitions
  3. Re-run kops update
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/model/gcemodel/autoscalinggroup.go:348 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/cb4aed4a60fbd28a. Report an issue: GitHub.