kubernetes/kops · error
GCE networks in legacy mode are not supported. Please conve
Error message
GCE networks in legacy mode are not supported. Please convert to auto mode or specify a different network.
What it means
Hard stop from Network.RenderGCE when an existing network (a != nil) is in legacy mode. Legacy networks lack subnetworks, which kOps requires; the task explicitly refuses to proceed and directs the user to convert the network or choose another one.
Source
Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:184
// is serialized, which results in the network being created with
// the auto-create subnetworks default of "true". Explicitly send
// the default value.
network.ForceSendFields = []string{"AutoCreateSubnetworks"}
default:
return fmt.Errorf("unhandled mode %q", e.Mode)
}
op, err := t.Cloud.Compute().Networks().Insert(t.Cloud.Project(), network)
if err != nil {
return fmt.Errorf("error creating Network: %v", err)
}
if err := t.Cloud.WaitForOp(op); err != nil {
return fmt.Errorf("error waiting for Network creation to complete: %w", err)
}
} else {
if a.Mode == "legacy" {
return fmt.Errorf("GCE networks in legacy mode are not supported. Please convert to auto mode or specify a different network.")
}
empty := &Network{}
if !reflect.DeepEqual(empty, changes) {
return fmt.Errorf("cannot apply changes to Network: %v", changes)
}
}
return nil
}
type terraformNetwork struct {
Name *string `cty:"name"`
IPv4Range *string `cty:"ipv4_range"`
Project *string `cty:"project"`
AutoCreateSubnetworks *bool `cty:"auto_create_subnetworks"`
}
func (_ *Network) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *Network) error {View on GitHub (pinned to 4c8573c808)
Solutions
- Migrate the GCE network from legacy to auto/custom subnet mode (gcloud compute networks update --switch-to-custom-subnet-mode) or use a different, non-legacy network
- Point the cluster spec's NetworkID at a subnet-capable network
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/gcetasks/network.go:184 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/26b0e46108158ec2.
Report an issue: GitHub.