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

  1. Run `kops create cluster --help` and pick a supported --networking value (e.g. cilium, calico, canal, kindnet).
  2. Fix typos in the flag value.
  3. 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

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


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/4ab9b51db2182e73. Report an issue: GitHub.