{"record":{"id":"b74b2907ece43bf9","repo":"kubernetes/kops","slug":"invalid-dedicated-instance-type-s","errorCode":null,"errorMessage":"invalid dedicated instance type: %s","messagePattern":"invalid dedicated instance type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/new_cluster.go","lineNumber":566,"sourceCode":"\t\t\t\t\treturn nil, fmt.Errorf(\"scheduler nodes requires the ExperimentalRoles feature flag to be enabled\")\n\t\t\t\tcase g.Spec.Role.HasKubeControllerManager():\n\t\t\t\t\treturn nil, fmt.Errorf(\"kube-controller-manager nodes requires the ExperimentalRoles feature flag to be enabled\")\n\t\t\t\t}\n\t\t\t}\n\t\t\tif g.Spec.MachineType == \"\" {\n\t\t\t\tg.Spec.MachineType, err = defaultMachineType(cloud, cluster, g)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, fmt.Errorf(\"error assigning default machine type for nodes: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tif ig.Spec.Tenancy != \"\" && ig.Spec.Tenancy != \"default\" {\n\t\t\tswitch cluster.GetCloudProvider() {\n\t\t\tcase api.CloudProviderAWS:\n\t\t\t\tif _, ok := awsDedicatedInstanceExceptions[g.Spec.MachineType]; ok {\n\t\t\t\t\treturn nil, fmt.Errorf(\"invalid dedicated instance type: %s\", g.Spec.MachineType)\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tklog.Warning(\"Trying to set tenancy on non-AWS environment\")\n\t\t\t}\n\t\t}\n\n\t\tif ig.IsControlPlane() {\n\t\t\tif len(ig.Spec.Subnets) == 0 {\n\t\t\t\treturn nil, fmt.Errorf(\"control-plane InstanceGroup %s did not specify any Subnets\", g.ObjectMeta.Name)\n\t\t\t}\n\t\t} else if ig.IsAPIServerOnly() && cluster.Spec.IsIPv6Only() {\n\t\t\tif len(ig.Spec.Subnets) == 0 {\n\t\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\t\tif subnet.Type != api.SubnetTypePrivate && subnet.Type != api.SubnetTypeUtility {\n\t\t\t\t\t\tig.Spec.Subnets = append(g.Spec.Subnets, subnet.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L548-L584","documentation":"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).","triggerScenarios":"`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.","commonSituations":"Compliance-driven dedicated tenancy requirements paired with burstable instance types; copying tenancy settings between clusters with different machine families.","solutions":["Choose a dedicated-tenancy-eligible machine type (e.g. m5, c5, r5 families) instead of the exception-listed type.","Remove tenancy (leave default/shared) if dedicated isolation is not required: drop --node-tenancy=dedicated.","If control-plane size conflicts, set --control-plane-size to an eligible family as well.","On non-AWS clouds this is only a warning, not an error; confirm you actually intended AWS."],"exampleFix":"// before\nkops create cluster --name=example.com --node-tenancy=dedicated --node-size=t3.medium\n// after\nkops create cluster --name=example.com --node-tenancy=dedicated --node-size=m5.large","handlingStrategy":"validation","validationCode":"var awsDedicatedExceptions = map[string]bool{\"t2.*\": true, \"t3.*\": true /* burstable + others */}\nif tenancy == \"dedicated\" && provider == \"aws\" && matchesAny(nodeIG.Spec.MachineType, awsDedicatedExceptions) {\n    return fmt.Errorf(\"%s not supported on dedicated tenancy\", nodeIG.Spec.MachineType)\n}","typeGuard":"func dedicatedTenancyOkAWS(machineType string) bool {\n    // t-family burstables and other exception types are not dedicated-capable\n    return !strings.HasPrefix(machineType, \"t2.\") && !strings.HasPrefix(machineType, \"t3.\") && !strings.HasPrefix(machineType, \"t4g.\")\n}","tryCatchPattern":"_, err := NewCluster(opt, cluster, zoneMap)\nif err != nil {\n    if strings.Contains(err.Error(), \"invalid dedicated instance type\") {\n        return fmt.Errorf(\"switch to a dedicated-eligible family (m5/c5/r5) or drop --node-tenancy=dedicated: %w\", err)\n    }\n    return err\n}","preventionTips":["Pair dedicated tenancy only with m5/c5/r5-style families","Validate tenancy+size combos in a preflight script","Don't copy tenancy settings from clusters with different instance families"],"tags":["aws","tenancy","instance-type","validation"],"backgroundTag":"instance-type-tenancy-mismatch","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}