Skip to content

Error when using multiple cidrBlocks #7358

@marvinWolff

Description

@marvinWolff

What steps did you take and what happened:
I tried to migrate a cluster to clusterclass.
The cluster has multiple cidr entries specified:

  clusterNetwork:
    pods:
      cidrBlocks:
      # The customer has several vpn-networks which should be excluded from pod-cidr-range, to ensure access from pods to these networks
      - "192.168.0.0/20"
      - "192.168.64.0/18"
      - "192.168.128.0/18"
      - "192.168.192.0/19"
      - "192.168.224.0/20"
    serviceDomain: cluster.local

When applied, we get the following error:

E1006 13:36:33.544202 1 controller.go:326] "Reconciler error" err="error computing the desired state of the Cluster topology: failed to apply patches: failed to generate patch request: failed to calculate global variables: pods: too many CIDRs specified" controller="topology/cluster" controllerGroup="cluster.x-k8s.io" controllerKind="Cluster" cluster="xxx" namespace="xxx" name="xxx" reconcileID=xxxx

What did you expect to happen:

That the cluster is created with the specified cidrs.

Anything else you would like to add:
I found the check that causes the error in here: https://github.com/kubernetes-sigs/cluster-api/blob/v1.2.0/api/v1beta1/cluster_types.go

The number of entries is limited to 2.

Environment:

  • Cluster-api version: 1.2.0
  • minikube/kind version: -
  • Kubernetes version: (use kubectl version): v1.23.9
  • OS (e.g. from /etc/os-release): ubuntu 20.04

/kind bug
/area label topology
/area label control-plane
/area label operator
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/clusterclassIssues or PRs related to clusterclassarea/control-planeIssues or PRs related to control-plane lifecycle managementkind/bugCategorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions