kubernetes/kops · error

spotinst: error building elastigroup: %v

Error message

spotinst: error building elastigroup: %v

What it means

buildElastigroup failed for one instance group; the wrap aggregates any error from SpotInst task construction (subnets, instance types, labels, volumes) so the real cause is in the wrapped error.

Source

Thrown at pkg/model/awsmodel/spotinst.go:197

		// Create both Master and Bastion instance groups as Elastigroups.
		case kops.InstanceGroupRoleControlPlane, kops.InstanceGroupRoleBastion:
			err = b.buildElastigroup(c, ig)

		// Create Node instance groups as Elastigroups or a single Ocean with
		// multiple LaunchSpecs.
		case kops.InstanceGroupRoleNode:
			if featureflag.SpotinstOcean.Enabled() {
				nodeSpotInstanceGroups = append(nodeSpotInstanceGroups, ig)
			} else {
				err = b.buildElastigroup(c, ig)
			}

		default:
			err = fmt.Errorf("spotinst: unexpected instance group role: %s", ig.Spec.Role)
		}

		if err != nil {
			return fmt.Errorf("spotinst: error building elastigroup: %v", err)
		}
	}

	if len(nodeSpotInstanceGroups) > 0 {
		if err = b.buildOcean(c, nodeSpotInstanceGroups...); err != nil {
			return fmt.Errorf("spotinst: error building ocean: %v", err)
		}
	}

	return nil
}

func (b *SpotInstanceGroupModelBuilder) buildElastigroup(c *fi.CloudupModelBuilderContext, ig *kops.InstanceGroup) (err error) {
	klog.V(4).Infof("Building instance group as Elastigroup: %q", b.AutoscalingGroupName(ig))
	group := &spotinsttasks.Elastigroup{
		Lifecycle:            b.Lifecycle,
		Name:                 new(b.AutoscalingGroupName(ig)),
		Region:               new(b.Region),

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the wrapped error for the specific construction failure
  2. Verify the instance group's machine type, subnets, and labels are valid for SpotInst
  3. Fix the instance group spec and re-run kops update
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/model/awsmodel/spotinst.go:197 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/261eab32277446c3. Report an issue: GitHub.