kubernetes/kops · error

could not find one of launch template or mixed instances pol

Error message

could not find one of launch template or mixed instances policy

What it means

An AutoScalingGroup must be launched either from a Launch Template or a MixedInstancesPolicy. When neither is populated on the task, kOps cannot build a valid CreateAutoScalingGroupInput and fails before calling AWS.

Source

Thrown at upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go:420

				},
			}
			p := request.MixedInstancesPolicy.LaunchTemplate
			for _, x := range e.MixedInstanceOverrides {
				p.Overrides = append(p.Overrides, autoscalingtypes.LaunchTemplateOverrides{
					InstanceType: new(x),
				},
				)
			}
			if e.InstanceRequirements != nil {
				p.Overrides = append(p.Overrides, overridesFromInstanceRequirements(e.InstanceRequirements))
			}
		} else if e.LaunchTemplate != nil {
			request.LaunchTemplate = &autoscalingtypes.LaunchTemplateSpecification{
				LaunchTemplateId: e.LaunchTemplate.ID,
				Version:          aws.String("$Latest"),
			}
		} else {
			return fmt.Errorf("could not find one of launch template or mixed instances policy")
		}

		// @step: attempt to create the autoscaling group for us
		if _, err := t.Cloud.Autoscaling().CreateAutoScalingGroup(ctx, request); err != nil {
			code := awsup.AWSErrorCode(err)
			message := awsup.AWSErrorMessage(err)
			if code == "ValidationError" && strings.Contains(message, "Invalid IAM Instance Profile name") {
				klog.V(4).Infof("error creating AutoscalingGroup: %s", message)
				return fi.NewTryAgainLaterError("waiting for the IAM Instance Profile to be propagated")
			}
			return fmt.Errorf("error creating AutoScalingGroup: %s", message)
		}

		// @step: attempt to enable the metrics for us
		if _, err := t.Cloud.Autoscaling().EnableMetricsCollection(ctx, &autoscaling.EnableMetricsCollectionInput{
			AutoScalingGroupName: e.Name,
			Granularity:          e.Granularity,
			Metrics:              e.Metrics,

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Upgrade kops to a version matching your cluster spec features (mixed instances/spot support)
  2. Review the InstanceGroup spec: ensure instance types and launch-template settings are valid so kOps generates a launch template
  3. Rebuild the cluster spec with `kops edit instancegroup` and re-run `kops update cluster`
  4. If it persists, file/check kops issues — this indicates a code path that should never be hit

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

# confirm kops generates a launch template for the instance group
kops get instancegroups --name mycluster -o yaml | grep -A3 launchTemplate
# and inspect the ASG create request in `kops update cluster --dry-run` output

Type guard

null

Try / catch

null

Prevention

When it happens

Trigger: RenderAWS reaches ASG creation with e.MixedInstanceOverrides/launch-template wiring absent AND e.LaunchTemplate == nil — i.e. the instance group produced neither configuration (internal wiring failure or unsupported combination of spec fields).

Common situations: Custom/patched cluster specs that bypass launch-template generation, unsupported instance-type mixes, or kOps bugs on older versions when spot instances/mixed policies were configured.

Related errors


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