kubernetes-sigs / cluster-api-ipam-provider-in-cluster

An IPAM provider for Cluster API that manages pools of IP addresses using Kubernetes resources.
Apache License 2.0
72 stars 24 forks source link

Two distinct globalinclusterippools can contain same ip ranges #272

Open lukastopiarz opened 2 months ago

lukastopiarz commented 2 months ago

Hello there,

I created by accident two globalinclusteripool CRs with unique names and same IP address ranges. No complaints from the admission webhook, nor IPAM operator. Cluster API is happily rolling new nodes with the same IP addresses 😯

image image

Cluster nodes with same IPs!

image

Shouldn't be this behaviour somehow checked and prohibited?

schrej commented 2 months ago

I think that's debatable. The in-cluster IPAM provider manages IP addresses in pools, but it does not manage the pools. Cluster Nodes can use the same subnet as long as your network setup allows it. Therefore there might be cases where someone wants to have two separate pools that use the same subnet, but live in e.g. two different data centers.

We could consider making this an optional feature, but then the question arises whether overlap validation should only cover global pools and regular pools per namespace, or all pools, regardless whether they're namespaced or global.