{"record":{"id":"361d1ee0e367bcb3","repo":"kubernetes/kops","slug":"no-networking-mode-set","errorCode":null,"errorMessage":"no networking mode set","messagePattern":"no networking mode set","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/components/awscloudcontrollermanager.go","lineNumber":68,"sourceCode":"\n\teccm.ClusterName = b.ClusterName\n\n\teccm.AllocateNodeCIDRs = new(!clusterSpec.IsKopsControllerIPAM())\n\n\tif eccm.ClusterCIDR == \"\" && !clusterSpec.IsKopsControllerIPAM() {\n\t\teccm.ClusterCIDR = clusterSpec.Networking.PodCIDR\n\t}\n\n\t// TODO: we want to consolidate this with the logic from KCM\n\tnetworking := &clusterSpec.Networking\n\tif networking.Kubenet != nil {\n\t\teccm.ConfigureCloudRoutes = new(true)\n\t} else if networking.External != nil {\n\t\teccm.ConfigureCloudRoutes = new(false)\n\t} else if UsesCNI(networking) {\n\t\teccm.ConfigureCloudRoutes = new(false)\n\t} else {\n\t\treturn fmt.Errorf(\"no networking mode set\")\n\t}\n\n\tif eccm.Image == \"\" {\n\t\teccm.Image = \"registry.k8s.io/provider-aws/cloud-controller-manager:v1.37.0\"\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":50,"sourceCodeEnd":77,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/components/awscloudcontrollermanager.go#L50-L77","documentation":"When building the AWS cloud-controller-manager component, the builder must decide eccm.ConfigureCloudRoutes based on the cluster's networking mode (kubenet => true; CNI/external => false). If cluster.spec.networking is nil or set to a mode none of the branches (External, UsesCNI, kubenet) recognize, the mode is undecidable and the builder fails.","triggerScenarios":"Rendering the AWS CCM model for a cluster whose NetworkingSpec is empty ({}) or whose only networking selector is not one of the supported modes checked in this branch chain.","commonSituations":"A hand-edited cluster.yaml with `networking: {}`; an upgrade that dropped the networking section; specifying a networking option the kops version doesn't recognize.","solutions":["Set an explicit networking mode in the cluster spec, e.g. `kops set cluster kubernetes.networking.cni.enabled=true` or edit spec.networking to include cni/calico/kubenet","Run `kops edit cluster` and add a networking block, then `kops update cluster`","Upgrade/align the kops CLI version with the cluster state if a newer networking mode is not recognized by this older builder"],"exampleFix":"# before\nnetworking: {}\n# after\nnetworking:\n  cni: {}","handlingStrategy":"validation","validationCode":"if cluster.Spec.Networking == nil || (cluster.Spec.Networking.Kubenet == nil && cluster.Spec.Networking.CNI == nil && cluster.Spec.Networking.External == nil && cluster.Spec.Networking.Calico == nil && cluster.Spec.Networking.Canal == nil) {\n\treturn fmt.Errorf(\"cluster %s has no networking mode set\", cluster.Name)\n}","typeGuard":"func networkingModeSet(n *kops.NetworkingSpec) bool {\n\treturn n != nil && n.Kubenet != nil || n != nil && n.CNI != nil || n != nil && n.External != nil\n}","tryCatchPattern":"if err := updateCluster(); err != nil {\n\tif strings.Contains(err.Error(), \"no networking mode set\") {\n\t\t// prompt user to set spec.networking and retry\n\t}\n\treturn err\n}","preventionTips":["Never leave `networking: {}` in cluster manifests","Use `kops set cluster kubernetes.networking.cni.enabled=true` rather than hand-editing","After upgrades, re-inspect spec.networking since some paths can drop it"],"tags":["networking","aws","cloud-controller-manager"],"backgroundTag":"missing-networking-config","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"}