Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoFreeRanges = errors.New("no free IP ranges available")
Functions ¶
This section is empty.
Types ¶
type AllocatedRange ¶ added in v0.1.0
AllocatedRange contains range of IPs allocated for the node
type AllocationConfig ¶
type AllocationConfig struct { PoolName string Subnet *net.IPNet Gateway net.IP PerNodeBlockSize int NodeSelector *corev1.NodeSelector }
AllocationConfig contains configuration of the IP pool
func (*AllocationConfig) Equal ¶
func (pc *AllocationConfig) Equal(other *AllocationConfig) bool
type PoolAllocator ¶ added in v0.1.0
type PoolAllocator struct {
// contains filtered or unexported fields
}
PoolAllocator contains pool settings and related allocations
func CreatePoolAllocatorFromIPPool ¶ added in v0.1.0
func CreatePoolAllocatorFromIPPool(ctx context.Context, p *ipamv1alpha1.IPPool, nodes sets.Set[string]) *PoolAllocator
CreatePoolAllocatorFromIPPool creates a PoolAllocator and load data from the IPPool CR the nodes Set contains the nodes that match the current NodeSelector of the IPPool it is used to filter out Allocations that are not relevant anymore
func (*PoolAllocator) AllocateFromPool ¶ added in v0.1.0
func (pa *PoolAllocator) AllocateFromPool(ctx context.Context, node string) (*AllocatedRange, error)
AllocateFromPool allocates a new range in the poolAllocator or return existing one, returns ErrNoFreeRanges if no free ranges available
func (*PoolAllocator) Deallocate ¶ added in v0.1.0
func (pa *PoolAllocator) Deallocate(ctx context.Context, node string)
Deallocate remove info about allocation for the node from the poolAllocator
Click to show internal directories.
Click to hide internal directories.