allocator

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

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 AllocationConfig

type AllocationConfig struct {
	PoolName         string
	Subnet           *net.IPNet
	Gateway          net.IP
	PerNodeBlockSize int
}

AllocationConfig contains configuration of the IP pool

func (*AllocationConfig) Equal

func (pc *AllocationConfig) Equal(other *AllocationConfig) bool

type Allocator

type Allocator struct {
	// contains filtered or unexported fields
}

func New

func New() *Allocator

New create and initialize new allocator

func (*Allocator) Allocate

func (a *Allocator) Allocate(ctx context.Context, nodeName string) (map[string]*pool.IPPool, error)

Allocate allocates ranges for node from all pools

func (*Allocator) Configure

func (a *Allocator) Configure(ctx context.Context, configs []AllocationConfig)

Configure update allocator configuration

func (*Allocator) ConfigureAndLoadAllocations

func (a *Allocator) ConfigureAndLoadAllocations(ctx context.Context, configs []AllocationConfig, nodes []corev1.Node)

ConfigureAndLoadAllocations configures allocator and load data from the node objects

func (*Allocator) Deallocate

func (a *Allocator) Deallocate(ctx context.Context, nodeName string)

Deallocate release all ranges allocated for node

func (*Allocator) IsConfigured

func (a *Allocator) IsConfigured() bool

IsConfigured returns true if allocator is configured

Jump to

Keyboard shortcuts

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