metal-stack/go-ipam

Support overlapping cidrs/prefixes

Closed this issue · 2 comments

Currently cidr/prefix is the primary key, therefore it is not possible to allocate the same prefix for two or more usage scenarios.
This restriction is valid for example for internet prefixes, but not for private network prefixes of nodes. They can overlap, the node prefixes must be disjoint, only if communication between the clusters is required.

A possible solution would be to make the primary key a joined primary key from UUID and CIDR/Prefix. The UUID is either totally unique, or a grouping,for example like a project or internet prefix.

Migration of the existing data to the new schema is a hard requirement.

This approach would also help to identify ips more easily in scenarios where they where released and acquired by different users.

@Gerrit91

New implementation is promising: #43

Another Idea would be to store the prefixes of another namespace in another table instead of adding a new column in postgres.