{"record":{"id":"49bc135f82c92d8a","repo":"kubernetes/kops","slug":"spotinst-unexpected-instance-group-role-s","errorCode":null,"errorMessage":"spotinst: unexpected instance group role: %s","messagePattern":"spotinst: unexpected instance group role: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/awsmodel/spotinst.go","lineNumber":193,"sourceCode":"\n\t\tklog.V(2).Infof(\"Building instance group: %q\", name)\n\t\tswitch ig.Spec.Role {\n\n\t\t// Create both Master and Bastion instance groups as Elastigroups.\n\t\tcase kops.InstanceGroupRoleControlPlane, kops.InstanceGroupRoleBastion:\n\t\t\terr = b.buildElastigroup(c, ig)\n\n\t\t// Create Node instance groups as Elastigroups or a single Ocean with\n\t\t// multiple LaunchSpecs.\n\t\tcase kops.InstanceGroupRoleNode:\n\t\t\tif featureflag.SpotinstOcean.Enabled() {\n\t\t\t\tnodeSpotInstanceGroups = append(nodeSpotInstanceGroups, ig)\n\t\t\t} else {\n\t\t\t\terr = b.buildElastigroup(c, ig)\n\t\t\t}\n\n\t\tdefault:\n\t\t\terr = fmt.Errorf(\"spotinst: unexpected instance group role: %s\", ig.Spec.Role)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"spotinst: error building elastigroup: %v\", err)\n\t\t}\n\t}\n\n\tif len(nodeSpotInstanceGroups) > 0 {\n\t\tif err = b.buildOcean(c, nodeSpotInstanceGroups...); err != nil {\n\t\t\treturn fmt.Errorf(\"spotinst: error building ocean: %v\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc (b *SpotInstanceGroupModelBuilder) buildElastigroup(c *fi.CloudupModelBuilderContext, ig *kops.InstanceGroup) (err error) {\n\tklog.V(4).Infof(\"Building instance group as Elastigroup: %q\", b.AutoscalingGroupName(ig))","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/awsmodel/spotinst.go#L175-L211","documentation":"The SpotInst model builder encountered an instance group role it cannot map — only control-plane, bastion, and node are handled; e.g. an api-server-role instance group in a SpotInst-enabled cluster.","triggerScenarios":"Thrown at pkg/model/awsmodel/spotinst.go:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move the workload to a supported role or disable SpotInst for that instance group","Check the instance group's spec.role","Report upstream if the role should be supported"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}