{"record":{"id":"7dc970e61e9c65e8","repo":"kubernetes/kops","slug":"invalid-dedicated-instance-type-s-7dc970","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/populate_instancegroup_spec.go","lineNumber":164,"sourceCode":"\t\t}\n\t}\n\n\tif ig.Spec.Image == \"\" {\n\t\tarchitecture, err := MachineArchitecture(cloud, ig.Spec.MachineType)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to determine machine architecture for InstanceGroup %q: %v\", ig.ObjectMeta.Name, err)\n\t\t}\n\t\tig.Spec.Image, err = defaultImage(cluster, channel, architecture)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"unable to determine default image for instance group %q: %v\", ig.ObjectMeta.Name, err)\n\t\t}\n\t}\n\n\tif ig.Spec.Tenancy != \"\" && ig.Spec.Tenancy != \"default\" {\n\t\tswitch cluster.GetCloudProvider() {\n\t\tcase kops.CloudProviderAWS:\n\t\t\tif _, ok := awsDedicatedInstanceExceptions[ig.Spec.MachineType]; ok {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid dedicated instance type: %s\", ig.Spec.MachineType)\n\t\t\t}\n\t\tdefault:\n\t\t\tklog.Warning(\"Trying to set tenancy on non-AWS environment\")\n\t\t}\n\t}\n\n\tif ig.IsControlPlane() {\n\t\tif len(ig.Spec.Subnets) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"control-plane InstanceGroup %s did not specify any Subnets\", ig.ObjectMeta.Name)\n\t\t}\n\t} else if ig.IsAPIServerOnly() && cluster.Spec.IsIPv6Only() {\n\t\tif len(ig.Spec.Subnets) == 0 {\n\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\tif subnet.Type != kops.SubnetTypePrivate && subnet.Type != kops.SubnetTypeUtility {\n\t\t\t\t\tig.Spec.Subnets = append(ig.Spec.Subnets, subnet.Name)\n\t\t\t\t}\n\t\t\t}\n\t\t}","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/populate_instancegroup_spec.go#L146-L182","documentation":"When spec.tenancy is set to something other than 'default', kOps only supports dedicated/hidden tenancy on AWS, and even there certain instance types are not allowed with dedicated tenancy. If the machine type appears in awsDedicatedInstanceExceptions, this error is thrown.","triggerScenarios":"An InstanceGroup with cloudProvider AWS, spec.tenancy: dedicated (or reserved/hidden), and spec.machineType listed in awsDedicatedInstanceExceptions (e.g. t2, t3, nano/micro burstable families that don't support dedicated tenancy).","commonSituations":"Copying a node spec with tenancy: dedicated onto t3/t2 burstable instances; setting tenancy on GCE/OpenStack clusters (triggers only a warning, not this error, but often a config mistake); not realizing dedicated instances incur large AWS surcharges and aren't available for all families.","solutions":["Change spec.machineType to an instance type supporting dedicated tenancy (e.g. m5, c5 families)","Remove spec.tenancy or set it to 'default' if dedicated tenancy isn't required","Review the awsDedicatedInstanceExceptions list in populate_instancegroup_spec.go to pick a valid type"],"exampleFix":"// before\nspec:\n  tenancy: dedicated\n  machineType: t3.medium\n// after\nspec:\n  tenancy: dedicated\n  machineType: m5.large","handlingStrategy":"validation","validationCode":"// Validate tenancy/machineType compatibility before apply\nif ig.Spec.Tenancy != \"\" && ig.Spec.Tenancy != \"default\" && cluster.GetCloudProvider() == kops.CloudProviderAWS {\n    if strings.HasPrefix(ig.Spec.MachineType, \"t2.\") || strings.HasPrefix(ig.Spec.MachineType, \"t3.\") {\n        return fmt.Errorf(\"%s does not support dedicated tenancy\", ig.Spec.MachineType)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use dedicated tenancy only with supported families (m5, c5, r5, etc.)","Only set tenancy on AWS clusters","Document tenancy costs; dedicated instances carry large surcharges"],"tags":["kops","aws","tenancy","validation"],"backgroundTag":"invalid-instance-tenancy","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"}