kubernetes/kops · error

insufficient (little) CIDRs remaining for automatic CIDR all

Error message

insufficient (little) CIDRs remaining for automatic CIDR allocation to subnet %q

What it means

When assigning CIDRs to 'little' subnets (Utility/Internal), kOps splits the first big CIDR into 8 children. If there are more little subnets needing auto-assignment than available children, it errors rather than reusing or overlapping CIDRs.

Source

Thrown at upup/pkg/fi/cloudup/subnets.go:226

	if len(bigCIDRs) == 0 {
		return fmt.Errorf("could not find any non-overlapping CIDRs in parent NetworkCIDR; cannot automatically assign CIDR to subnet")
	}

	// Assign CIDRs to little subnets
	if len(littleSubnets) > 0 {
		littleCIDRs, err := subnet.SplitInto8(bigCIDRs[0])
		if err != nil {
			return err
		}
		bigCIDRs = bigCIDRs[1:]

		for _, subnet := range littleSubnets {
			if subnet.CIDR != "" {
				continue
			}

			if len(littleCIDRs) == 0 {
				return fmt.Errorf("insufficient (little) CIDRs remaining for automatic CIDR allocation to subnet %q", subnet.Name)
			}
			subnet.CIDR = littleCIDRs[0].String()
			klog.Infof("Assigned CIDR %s to subnet %s", subnet.CIDR, subnet.Name)

			littleCIDRs = littleCIDRs[1:]
		}
	}

	// Assign CIDRs to big subnets
	for _, subnet := range bigSubnets {
		if subnet.CIDR != "" {
			continue
		}
		if subnet.IPv6CIDR != "" && subnet.Type == kops.SubnetTypePrivate {
			continue
		}

		if len(bigCIDRs) == 0 {

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Explicitly set cidr on the extra little subnets so auto-allocation is not needed
  2. Enlarge networkCIDR so the split produces sufficient room, or add additionalNetworkCIDR
  3. Reduce the number of auto-assigned utility subnets (e.g. share one utility subnet across AZs)

Example fix

// before
subnets:
- name: utility-us-east-1a  # no cidr, 9th little subnet
// after
subnets:
- name: utility-us-east-1a
  cidr: 10.0.9.0/24
Defensive patterns

Strategy: validation

Validate before calling

little := 0
for _, s := range subnets {
	if s.Type == kops.SubnetTypeUtility && s.CIDR == "" { little++ }
}
// SplitInto8 yields 8 children per big CIDR; ensure little <= 8 * len(bigCIDRs)

Try / catch

if err := PerformAssignments(c, cloud); err != nil {
	if strings.Contains(err.Error(), "insufficient (little) CIDRs") { /* add explicit CIDRs for extra utility subnets */ }
	return err
}

Prevention

When it happens

Trigger: More subnets classified as Utility (or other little types) without explicit CIDRs than the 8 pieces produced by SplitInto8 of bigCIDRs[0], during `kops update cluster`.

Common situations: Clusters with many AZs each adding a utility subnet; adding several subnets at once without specifying CIDRs; very small parent networkCIDR yielding tiny carvable ranges.

Related errors


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