kubernetes/kops · error

invalid dedicated instance type: %s

Error message

invalid dedicated instance type: %s

What it means

On AWS, dedicated tenancy does not support certain instance types. When an instance group sets tenancy to 'dedicated' (or any non-default), kops checks the machine type against awsDedicatedInstanceExceptions and rejects disallowed types (e.g. t-family burstable).

Source

Thrown at upup/pkg/fi/cloudup/new_cluster.go:566

					return nil, fmt.Errorf("scheduler nodes requires the ExperimentalRoles feature flag to be enabled")
				case g.Spec.Role.HasKubeControllerManager():
					return nil, fmt.Errorf("kube-controller-manager nodes requires the ExperimentalRoles feature flag to be enabled")
				}
			}
			if g.Spec.MachineType == "" {
				g.Spec.MachineType, err = defaultMachineType(cloud, cluster, g)
				if err != nil {
					return nil, fmt.Errorf("error assigning default machine type for nodes: %v", err)
				}
			}

		}

		if ig.Spec.Tenancy != "" && ig.Spec.Tenancy != "default" {
			switch cluster.GetCloudProvider() {
			case api.CloudProviderAWS:
				if _, ok := awsDedicatedInstanceExceptions[g.Spec.MachineType]; ok {
					return nil, fmt.Errorf("invalid dedicated instance type: %s", g.Spec.MachineType)
				}
			default:
				klog.Warning("Trying to set tenancy on non-AWS environment")
			}
		}

		if ig.IsControlPlane() {
			if len(ig.Spec.Subnets) == 0 {
				return nil, fmt.Errorf("control-plane InstanceGroup %s did not specify any Subnets", g.ObjectMeta.Name)
			}
		} else if ig.IsAPIServerOnly() && cluster.Spec.IsIPv6Only() {
			if len(ig.Spec.Subnets) == 0 {
				for _, subnet := range cluster.Spec.Networking.Subnets {
					if subnet.Type != api.SubnetTypePrivate && subnet.Type != api.SubnetTypeUtility {
						ig.Spec.Subnets = append(g.Spec.Subnets, subnet.Name)
					}
				}
			}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Choose a dedicated-tenancy-eligible machine type (e.g. m5, c5, r5 families) instead of the exception-listed type.
  2. Remove tenancy (leave default/shared) if dedicated isolation is not required: drop --node-tenancy=dedicated.
  3. If control-plane size conflicts, set --control-plane-size to an eligible family as well.
  4. On non-AWS clouds this is only a warning, not an error; confirm you actually intended AWS.

Example fix

// before
kops create cluster --name=example.com --node-tenancy=dedicated --node-size=t3.medium
// after
kops create cluster --name=example.com --node-tenancy=dedicated --node-size=m5.large
Defensive patterns

Strategy: validation

Validate before calling

var awsDedicatedExceptions = map[string]bool{"t2.*": true, "t3.*": true /* burstable + others */}
if tenancy == "dedicated" && provider == "aws" && matchesAny(nodeIG.Spec.MachineType, awsDedicatedExceptions) {
    return fmt.Errorf("%s not supported on dedicated tenancy", nodeIG.Spec.MachineType)
}

Type guard

func dedicatedTenancyOkAWS(machineType string) bool {
    // t-family burstables and other exception types are not dedicated-capable
    return !strings.HasPrefix(machineType, "t2.") && !strings.HasPrefix(machineType, "t3.") && !strings.HasPrefix(machineType, "t4g.")
}

Try / catch

_, err := NewCluster(opt, cluster, zoneMap)
if err != nil {
    if strings.Contains(err.Error(), "invalid dedicated instance type") {
        return fmt.Errorf("switch to a dedicated-eligible family (m5/c5/r5) or drop --node-tenancy=dedicated: %w", err)
    }
    return err
}

Prevention

When it happens

Trigger: `kops create cluster --node-tenancy=dedicated` combined with a machine type that AWS does not allow on dedicated hosts, e.g. --node-size=t3.medium.

Common situations: Compliance-driven dedicated tenancy requirements paired with burstable instance types; copying tenancy settings between clusters with different machine families.

Related errors


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