kubernetes/kops · error
control-plane InstanceGroup %s did not specify any Subnets
Error message
control-plane InstanceGroup %s did not specify any Subnets
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/populate_instancegroup_spec.go:173
if err != nil {
return nil, fmt.Errorf("unable to determine default image for instance group %q: %v", ig.ObjectMeta.Name, err)
}
}
if ig.Spec.Tenancy != "" && ig.Spec.Tenancy != "default" {
switch cluster.GetCloudProvider() {
case kops.CloudProviderAWS:
if _, ok := awsDedicatedInstanceExceptions[ig.Spec.MachineType]; ok {
return nil, fmt.Errorf("invalid dedicated instance type: %s", ig.Spec.MachineType)
}
default:
klog.Warning("Trying to set tenancy on non-AWS environment")
}
}
if ig.IsControlPlane() {
if len(ig.Spec.Subnets) == 0 {
return nil, fmt.Errorf("control-plane InstanceGroup %s did not specify any Subnets", ig.ObjectMeta.Name)
}
} else if ig.IsAPIServerOnly() && cluster.Spec.IsIPv6Only() {
if len(ig.Spec.Subnets) == 0 {
for _, subnet := range cluster.Spec.Networking.Subnets {
if subnet.Type != kops.SubnetTypePrivate && subnet.Type != kops.SubnetTypeUtility {
ig.Spec.Subnets = append(ig.Spec.Subnets, subnet.Name)
}
}
}
} else {
if len(ig.Spec.Subnets) == 0 {
for _, subnet := range cluster.Spec.Networking.Subnets {
if subnet.Type != kops.SubnetTypeDualStack && subnet.Type != kops.SubnetTypeUtility {
ig.Spec.Subnets = append(ig.Spec.Subnets, subnet.Name)
}
}
}
View on GitHub (pinned to 4c8573c808)
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
Example fix
// before metadata: name: control-plane-us-east-1a spec: role: Master // after spec: role: Master subnets: - us-east-1a
Defensive patterns
Strategy: validation
Validate before calling
// Ensure control-plane IG has subnets before calling kops
if ig.IsControlPlane() && len(ig.Spec.Subnets) == 0 {
ig.Spec.Subnets = []string{"us-east-1a"} // pick from cluster.spec.networking.subnets
}
// or reject early:
if ig.IsControlPlane() && len(ig.Spec.Subnets) == 0 {
return errors.New("control-plane instance group requires spec.subnets")
} Prevention
- 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
When it happens
Trigger: `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.
Common situations: 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.
Related errors
- error subnets must exist in the cluster
- error instance group cannot span public and private subnets
- must configure at least one ControlPlane InstanceGroup
- unable to infer any Subnets for InstanceGroup %s
- invalid InstanceGroup name: %v
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/8376c9c1873ba4e7.
Report an issue: GitHub.