Skip to content

Remove IP Family from API types and cluster class builtin variables #7521

@killianmuldoon

Description

@killianmuldoon

This issue is for discussion on whether an "IPFamily" concept and restriction is useful and concretely definable in a way that works across Cluster API providers.

Since the introduction of dual stack networking in Cluster API - in particular its use in tests in CAPD - Cluster API has a definition of a valid "IPFamily" for a Cluster. This is an indication of whether the Pod and Service CIDR blocks are compatible with one another.

This concept is used in the Cluster Topology controller as "IPFamily" is available as a variable. It can be one of IPv4, IPv6 or Dualstack.

Cluster API calculates this value here:

func (c *Cluster) GetIPFamily() (ClusterIPFamily, error) {

It comes down to:

  1. If both pods and service CIDR blocks are IPv4, the Cluster IPFamily is IPv4
  2. If both pods and service CIDR blocks are IPv6, the Cluster IPFamily is IPv6
  3. If both pods CIDR entry is Dualstack, the Cluster IPFamily is Dualstack
  4. Otherwise if the pods and service CIDR blocks are not identical the IPFamily is invalid.

Case 4. causes the Cluster Topology controller to throw a reconciliation error today.

As far as I understand this check was introduced because this is the validation that the DockerLoadBalancer does today, but I'm not sure this is the correct concept for a Cluster IPFamily, or if such a concept is definable across infrastructure providers.

Kubernetes does not AFAIK have any such concept today, and you can create clusters with Kubeadm that violate the rules for Cluster API.

Some additional context and conversation around this can be found in: #7420. This change also (at time of writing) adds strict validation that the Cluster IP family must be valid in line with Cluster API's definition.

Is it necessary to define an "IPFamily" for CAPI Clusters? Is it useful to expose it e.g. as a variable for ClusterClass-based clusters?

Metadata

Metadata

Assignees

Labels

help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/api-changeCategorizes issue or PR as related to adding, removing, or otherwise changing an APIkind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.priority/backlogHigher priority than priority/awaiting-more-evidence.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions