Skip to main content

Module allocator

Module allocator 

Source
Expand description

IP address allocation for overlay networks

Manages allocation and tracking of overlay IP addresses within a CIDR range. Supports both IPv4 and IPv6 (dual-stack) networks.

Structs§

IpAllocator
IP allocator for overlay network addresses
IpAllocatorState
Persistent state for IP allocator
NodeSliceAllocator
Leader-side allocator that carves per-node slices out of a cluster CIDR.
NodeSliceAllocatorSnapshot
Persistent snapshot of a NodeSliceAllocator for raft/disk persistence.
ServiceSubnetRegistry
Tracks per-service-per-node subnet assignments carved from the cluster CIDR. Each (service_name, node_id) pair gets its own slice of size slice_prefix (default /28). Assignments are deterministic — the same (service, node) pair always maps to the same starting slot via FNV hash, with linear probing on collision. Mirrors NodeSliceAllocator’s pattern; see that type for the rationale (in particular the choice of FNV over DefaultHasher for cross-process reproducibility).
ServiceSubnetRegistrySnapshot
Persistent snapshot of a ServiceSubnetRegistry for raft/disk persistence.

Functions§

first_ip_from_cidr
Helper function to get the first usable IP from a CIDR