{"record":{"id":"4f9e99f2b8c4a2b2","repo":"kubernetes/kops","slug":"control-plane-instancegroup-s-did-not-specify-any","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/new_cluster.go","lineNumber":575,"sourceCode":"\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}\n\t\t} else {\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.SubnetTypeDualStack && subnet.Type != api.SubnetTypeUtility {\n\t\t\t\t\t\tg.Spec.Subnets = append(g.Spec.Subnets, subnet.Name)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n","sourceCodeStart":557,"sourceCodeEnd":593,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/new_cluster.go#L557-L593","documentation":"Control-plane instance groups must have at least one subnet so kops knows where to place the masters. During instance-group finalization, a control-plane group with empty spec.subnets aborts creation with this message.","triggerScenarios":"`kops create cluster` with explicit instance group YAML lacking `subnets:`, or `kops create ig -f` for a control-plane group without subnets specified.","commonSituations":"Hand-written instance group manifests; templating that dropped the subnets field; converting clusters to explicit networking topology without updating IG specs.","solutions":["Add subnets to the control-plane instance group: `spec: subnets: [us-east-1a, us-east-1b]` matching cluster subnets.","When using `kops create cluster`, pass --zones (and --networking/ topology flags) so kops auto-assigns subnets instead of hand-writing IG specs.","Edit with `kops edit ig <name>` / fix the YAML, then `kops update cluster` again."],"exampleFix":"// before\n# control-plane IG yaml\nmetadata:\n  name: master-us-east-1a\nspec:\n  role: ControlPlane\n// after\nmetadata:\n  name: master-us-east-1a\nspec:\n  role: ControlPlane\n  subnets:\n  - us-east-1a","handlingStrategy":"validation","validationCode":"for _, ig := range instanceGroups {\n    if ig.IsControlPlane() && len(ig.Spec.Subnets) == 0 {\n        return fmt.Errorf(\"control-plane IG %s needs subnets before create\", ig.Name)\n    }\n}","typeGuard":"func controlPlaneSubnetsSet(ig *api.InstanceGroup) bool {\n    return ig != nil && ig.IsControlPlane() && len(ig.Spec.Subnets) > 0\n}","tryCatchPattern":"_, err := NewCluster(opt, cluster, zoneMap)\nif err != nil {\n    if strings.Contains(err.Error(), \"did not specify any Subnets\") {\n        return fmt.Errorf(\"add spec.subnets to the control-plane IG or pass --zones: %w\", err)\n    }\n    return err\n}","preventionTips":["Include subnets in every hand-written IG manifest","Pass --zones so kops auto-derives subnets","Lint cluster specs to require subnets on ControlPlane-role groups"],"tags":["subnets","control-plane","instance-group","configuration"],"backgroundTag":"missing-required-argument","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"}