pool

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

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

func InitBitmap(size, offset uint) (string, uint)

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 NewAllocator(c client.Client, poolNamePrefix, namespace string, poolSize uint) Allocator

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL