kubernetes/kops · error

error building auto scaler options: %v

Error message

error building auto scaler options: %v

What it means

buildElastigroup calls b.buildAutoScalerOpts(b.ClusterName(), ig) to derive cluster-autoscaler options (labels, taints, min/max, etc.) for the group. This wrapper fires when building those options fails, aborting Elastigroup creation during `kops update cluster`.

Source

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

		return fmt.Errorf("error building subnets: %v", err)
	}

	// Capacity.
	group.MinSize, group.MaxSize = b.buildCapacity(ig)

	// Monitoring.
	group.Monitoring = ig.Spec.DetailedInstanceMonitoring

	// Tags.
	group.Tags, err = b.buildTags(ig)
	if err != nil {
		return fmt.Errorf("error building cloud tags: %v", err)
	}

	// Auto Scaler.
	group.AutoScalerOpts, err = b.buildAutoScalerOpts(b.ClusterName(), ig)
	if err != nil {
		return fmt.Errorf("error building auto scaler options: %v", err)
	}
	if group.AutoScalerOpts != nil { // remove unsupported options
		group.AutoScalerOpts.Taints = nil
	}

	// Instance Metadata Options
	group.InstanceMetadataOptions = b.buildInstanceMetadataOptions(ig)

	klog.V(4).Infof("Adding task: Elastigroup/%s", fi.ValueOf(group.Name))
	c.AddTask(group)

	return nil
}

func (b *SpotInstanceGroupModelBuilder) buildOcean(c *fi.CloudupModelBuilderContext, igs ...*kops.InstanceGroup) (err error) {
	klog.V(4).Infof("Building instance group as Ocean: %q", "nodes."+b.ClusterName())
	ocean := &spotinsttasks.Ocean{
		Lifecycle: b.Lifecycle,

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Read the wrapped inner error; it names the option that failed to parse.
  2. Fix the autoscaler labels/taints syntax in the cluster or instance group spec.
  3. Compare against a fresh kops cluster template for your kOps version to ensure the option format is current.
  4. Re-run `kops update cluster`.

Example fix

// before
autoscaleLabels: "role=node effect=NoSchedule"
// after
autoscaleTaints: "dedicated=gpu:NoSchedule"
Defensive patterns

Strategy: validation

Validate before calling

for _, t := range ig.Spec.TeamTaints() { // or your autoscaler taint labels
  parts := strings.Split(t, ":")
  if len(parts) != 2 || !validEffects[parts[1]] {
    return fmt.Errorf("invalid autoscaler taint %q", t)
  }
}

Try / catch

if err := kopsUpdate(); err != nil {
  if strings.Contains(err.Error(), "error building auto scaler options") {
    // correct the autoscaler label/taint syntax and retry
  }
}

Prevention

When it happens

Trigger: `kops update cluster` with Spotinst where autoscaler option parsing fails — typically malformed autoscaler label/taint expressions on the instance group or cluster spec that the builder cannot parse.

Common situations: Hand-edited autoscaler taint/label strings with wrong key=value[:effect] syntax; clusters upgraded across kOps versions where option formats changed; copy-pasted Spotinst labels from other clusters.

Related errors


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