{"record":{"id":"8376c9c1873ba4e7","repo":"kubernetes/kops","slug":"control-plane-instancegroup-s-did-not-specify-any-8376c9","errorCode":null,"errorMessage":"control-plane InstanceGroup %s did not specify any Subnets","messagePattern":"control-plane InstanceGroup (.+?) did not specify any Subnets","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/populate_instancegroup_spec.go","lineNumber":173,"sourceCode":"\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}\n\t} else {\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.SubnetTypeDualStack && 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}\n","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/populate_instancegroup_spec.go#L155-L191","documentation":"Every control-plane InstanceGroup must explicitly list which subnets its machines run in, since control-plane placement is critical. If ig.IsControlPlane() and spec.subnets is empty, kOps refuses to guess and returns this error.","triggerScenarios":"`kops create instancegroup` with role Master/control-plane and no --subnet flag; editing YAML to delete spec.subnets on a control-plane group; running `kops update cluster` after subnets were stripped from the IG manifest.","commonSituations":"Hand-writing control-plane InstanceGroup YAML and forgetting subnets; automated tooling regenerating IGs without carrying subnets over; migrating from older configs where subnet fields lived elsewhere.","solutions":["Add spec.subnets to the control-plane InstanceGroup (e.g. [us-east-1a, us-east-1b] or dual-stack/IPv6 subnets as appropriate)","Pass --subnet when creating the group: `kops create instancegroup control-plane --role Master --subnet <name>`","Ensure the subnets referenced exist in cluster.spec.networking.subnets"],"exampleFix":"// before\nmetadata:\n  name: control-plane-us-east-1a\nspec:\n  role: Master\n// after\nspec:\n  role: Master\n  subnets:\n  - us-east-1a","handlingStrategy":"validation","validationCode":"// Ensure control-plane IG has subnets before calling kops\nif ig.IsControlPlane() && len(ig.Spec.Subnets) == 0 {\n    ig.Spec.Subnets = []string{\"us-east-1a\"} // pick from cluster.spec.networking.subnets\n}\n// or reject early:\nif ig.IsControlPlane() && len(ig.Spec.Subnets) == 0 {\n    return errors.New(\"control-plane instance group requires spec.subnets\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --subnet when creating control-plane groups","Cross-check IG subnets against cluster.spec.networking.subnets in CI","Never strip subnets when regenerating IG manifests with tooling"],"tags":["kops","subnets","control-plane","validation"],"backgroundTag":"missing-subnet-configuration","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"}