Documentation
¶
Index ¶
Constants ¶
View Source
const ( PoolStateLabel = "allocation.cybericebox.com/state" LatestPoolLabel = "allocation.cybericebox.com/latest" PoolGroupLabel = "allocation.cybericebox.com/group" PoolStateEmpty = "empty" PoolStatePartial = "partial" PoolStateFull = "full" // PoolTypeLabel carries semantic pool type (vni, vpn-clients, lab-subnets). PoolTypeLabel = "pool.cybericebox.com/type" // Semantic pool type values. PoolTypeVPNClients = "vpn-clients" PoolTypeLabSubnets = "lab-subnets" PoolTypeVNI = "vni" )
View Source
const CursorAnnotation = "allocation.cybericebox.com/cursor"
CursorAnnotation on a Pool remembers where a rotating allocator handed out last.
Variables ¶
This section is empty.
Functions ¶
func InitBitmap ¶
InitBitmap initialises a pool's bitmap and returns (encodedBitmap, freeCount). Bit 0 is reserved when offset == 0 to avoid assigning the network-address index.
Types ¶
type Allocator ¶
type Allocator interface {
AllocateIndex(ctx context.Context) (uint, error)
ReleaseIndex(ctx context.Context, index uint) error
}
func NewAllocator ¶
func NewRotatingAllocator ¶
func NewRotatingAllocator(c client.Client, poolNamePrefix, namespace string, poolSize uint) Allocator
NewRotatingAllocator is NewAllocator with indexes that are not reused until the pool has been walked (see allocator.rotate): the VNIs of the lab networks, where the same number meeting a new lab at once could inherit stale flows on a node.
Click to show internal directories.
Click to hide internal directories.