kubernetes/kops · error
unknown networking mode %q
Error message
unknown networking mode %q
What it means
setupNetworking translates the --networking flag into the cluster spec's networking section. Any value not in the supported set (e.g. cilium, calico, canal, kube-router, gcp/gce, kindnet, etc.) falls to the default branch and aborts cluster creation with this error naming the offending value.
Source
Thrown at upup/pkg/fi/cloudup/new_cluster.go:1362
}
enabled := false
cluster.Spec.KubeProxy.Enabled = &enabled
case "amazonvpc", "amazon-vpc-routed-eni":
cluster.Spec.Networking.AmazonVPC = &api.AmazonVPCNetworkingSpec{}
case "cilium", "":
addCiliumNetwork(cluster)
case "cilium-etcd":
addCiliumNetwork(cluster)
cluster.Spec.Networking.Cilium.EtcdManaged = true
case "cilium-eni":
addCiliumNetwork(cluster)
cluster.Spec.Networking.Cilium.IPAM = "eni"
case "gcp", "gce":
cluster.Spec.Networking.GCP = &api.GCPNetworkingSpec{}
case "kindnet":
cluster.Spec.Networking.Kindnet = &api.KindnetNetworkingSpec{}
default:
return fmt.Errorf("unknown networking mode %q", opt.Networking)
}
klog.V(4).Infof("networking mode=%s => %s", opt.Networking, fi.DebugAsJsonString(cluster.Spec.Networking))
return nil
}
func setupTopology(opt *NewClusterOptions, cluster *api.Cluster, allZones sets.String) ([]*api.InstanceGroup, error) {
var bastions []*api.InstanceGroup
if opt.Topology == "" {
if opt.IPv6 {
opt.Topology = api.TopologyPrivate
} else {
opt.Topology = api.TopologyPublic
}
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Run `kops create cluster --help` and pick a supported --networking value (e.g. cilium, calico, canal, kindnet).
- Fix typos in the flag value.
- If using a removed CNI, migrate to a supported one (e.g. --networking cilium) or pin the older kops version that still supports it.
Example fix
// before kops create cluster my.cluster --networking ciluim // after kops create cluster my.cluster --networking cilium
Defensive patterns
Strategy: validation
Validate before calling
kops create cluster --help 2>&1 | grep -A20 networking # verify --networking value against the supported list
Try / catch
if err := createCluster(); err != nil && strings.Contains(err.Error(), "unknown networking mode") { /* correct the --networking value and retry */ } Prevention
- Copy flag values only from the kops help of the installed version
- Re-check scripts after kops upgrades (CNIs get removed)
- Add a whitelist check in wrapper scripts
When it happens
Trigger: `kops create cluster --networking <unsupported-value>` — e.g. a typo like `--networking ciluim`, an old option removed from newer kops (flannel/weave/romana in recent versions), or a misspelled choice passed by a script.
Common situations: Upgrading kops and reusing old scripts whose --networking value is no longer supported (e.g. --networking weave); typos; copying flags from a different tool (e.g. kubeadm's CNI names); shell variable defaulting to an empty/odd value.
Understand the failure class
Background: "unknown output mode", "invalid value for flag", "expects true/false": fixing invalid flag value errors in CLI tools — this error's family across 24 libraries.
Related errors
- specified %d control-plane zones, but also requested %d cont
- bastion supports --topology='private' only
- invalid topology %s
- unknown DNSType: %q
- InstanceGroup %q not found
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/4ab9b51db2182e73.
Report an issue: GitHub.