{"record":{"id":"ff454029412c2ec3","repo":"kubernetes/kops","slug":"insufficient-big-cidrs-remaining-for-automatic-c","errorCode":null,"errorMessage":"insufficient (big) CIDRs remaining for automatic CIDR allocation to subnet %q","messagePattern":"insufficient \\(big\\) CIDRs remaining for automatic CIDR allocation to subnet %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/subnets.go","lineNumber":245,"sourceCode":"\t\t\t}\n\t\t\tsubnet.CIDR = littleCIDRs[0].String()\n\t\t\tklog.Infof(\"Assigned CIDR %s to subnet %s\", subnet.CIDR, subnet.Name)\n\n\t\t\tlittleCIDRs = littleCIDRs[1:]\n\t\t}\n\t}\n\n\t// Assign CIDRs to big subnets\n\tfor _, subnet := range bigSubnets {\n\t\tif subnet.CIDR != \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tif subnet.IPv6CIDR != \"\" && subnet.Type == kops.SubnetTypePrivate {\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(bigCIDRs) == 0 {\n\t\t\treturn fmt.Errorf(\"insufficient (big) CIDRs remaining for automatic CIDR allocation to subnet %q\", subnet.Name)\n\t\t}\n\t\tsubnet.CIDR = bigCIDRs[0].String()\n\t\tklog.Infof(\"Assigned CIDR %s to subnet %s\", subnet.CIDR, subnet.Name)\n\n\t\tbigCIDRs = bigCIDRs[1:]\n\t}\n\n\treturn nil\n}\n\n// allSubnetsHaveCIDRs returns true iff each subnet in the cluster has a non-empty CIDR\nfunc allSubnetsHaveCIDRs(c *kops.Cluster) bool {\n\tfor i := range c.Spec.Networking.Subnets {\n\t\tsubnet := &c.Spec.Networking.Subnets[i]\n\t\tif subnet.CIDR != \"\" {\n\t\t\tcontinue\n\t\t}\n","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/subnets.go#L227-L263","documentation":"'Big' subnets (Public/Private) get CIDRs assigned from the pool of non-overlapping big CIDRs carved from the parent networkCIDR. When that pool is exhausted before all big subnets have a CIDR, kOps fails rather than allocating overlapping space.","triggerScenarios":"More Public/Private subnets without explicit CIDRs than non-overlapping big CIDRs available after removing reserved subnets, during PerformAssignments in `kops update cluster`.","commonSituations":"Adding AZs beyond what the networkCIDR can carve; subnets skipped due to IPv6-only private config reducing the pool; small networkCIDR (e.g. /27) with many private subnets.","solutions":["Enlarge cluster.spec.networkCIDR or add additionalNetworkCIDRs to grow the big CIDR pool","Assign explicit, non-overlapping CIDRs to the remaining subnets","Delete or consolidate unused subnets so the existing pool suffices"],"exampleFix":"// before\nspec:\n  networkCIDR: 10.0.0.0/24  # 4 subnets requested\n// after\nspec:\n  networkCIDR: 10.0.0.0/16","handlingStrategy":"validation","validationCode":"big := 0\nfor _, s := range subnets {\n\tif (s.Type == kops.SubnetTypePublic || s.Type == kops.SubnetTypePrivate) && s.CIDR == \"\" { big++ }\n}\n// compare big against count of non-overlapping big CIDRs carved from networkCIDR","typeGuard":null,"tryCatchPattern":"if err := PerformAssignments(c, cloud); err != nil {\n\tif strings.Contains(err.Error(), \"insufficient (big) CIDRs\") { /* enlarge networkCIDR or assign explicit CIDRs */ }\n\treturn err\n}","preventionTips":["Use a networkCIDR large enough for one subnet per AZ (e.g. /16 for many AZs)","Pre-assign explicit CIDRs when exceeding 8-ish subnets","Review subnet additions against remaining CIDR headroom"],"tags":["network","cidr","capacity","kops"],"backgroundTag":"cidr-space-exhausted","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}