kubernetes/kops · error

found multiple instance groups matching group: %q

Error message

found multiple instance groups matching group: %q

What it means

findInstanceGroupFromResource maps a Spotinst Elastigroup/Ocean resource back to a kOps InstanceGroup via a role-derived group name; two InstanceGroups produced the same group name, so the resource-to-IG mapping is ambiguous and kOps refuses to guess.

Source

Thrown at pkg/resources/spotinst/resources.go:405

		}
	}

	return nil
}

func findInstanceGroupFromResource(cluster *kops.Cluster, instanceGroups []*kops.InstanceGroup,
	resource *resources.Resource) (*kops.InstanceGroup, error,
) {
	var instanceGroup *kops.InstanceGroup
	for _, ig := range instanceGroups {
		name := getGroupNameByRole(cluster, ig)
		if name == "" {
			continue
		}

		if name == resource.Name {
			if instanceGroup != nil {
				return nil, fmt.Errorf("found multiple instance groups matching group: %q", name)
			}

			klog.V(2).Infof("Found group with corresponding instance group: %q", name)
			instanceGroup = ig
		}
	}

	return instanceGroup, nil
}

func getGroupNameByRole(cluster *kops.Cluster, ig *kops.InstanceGroup) string {
	var groupName string

	switch {
	case ig.Spec.Role.HasControlPlane():
		groupName = ig.ObjectMeta.Name + ".masters." + cluster.ObjectMeta.Name
	case ig.Spec.Role.HasNode():
		groupName = ig.ObjectMeta.Name + "." + cluster.ObjectMeta.Name

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Remove or rename the duplicate InstanceGroups so each role maps to a unique group name
  2. Check the cluster's IG names for collisions that normalize to the same Spotinst group name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/resources/spotinst/resources.go:405 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/4a4ec46c0c097f38. Report an issue: GitHub.