ipampool

package
v1.4.15 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRefreshDelay pool monitor poll delay default in seconds.
	DefaultRefreshDelay = 1 * time.Second
	// DefaultMaxIPs default maximum allocatable IPs
	DefaultMaxIPs = 250
)

Variables

This section is empty.

Functions

func CalculateMaxFreeIPs

func CalculateMaxFreeIPs(scaler v1alpha.Scaler) int

CalculateMaxFreeIPs calculates the maximum free IP quantity based on the Scaler in the passed NodeNetworkConfig.

func CalculateMinFreeIPs

func CalculateMinFreeIPs(scaler v1alpha.Scaler) int

CalculateMinFreeIPs calculates the minimum free IP quantity based on the Scaler in the passed NodeNetworkConfig.

Types

type Monitor

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

func NewMonitor

func NewMonitor(httpService cns.HTTPService, nnccli nodeNetworkConfigSpecUpdater, opts *Options) *Monitor

func (*Monitor) GetStateSnapshot

func (pm *Monitor) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot

GetStateSnapshot gets a snapshot of the IPAMPoolMonitor struct.

func (*Monitor) Start

func (pm *Monitor) Start(ctx context.Context) error

func (*Monitor) Update

func (pm *Monitor) Update(nnc *v1alpha.NodeNetworkConfig)

Update ingests a NodeNetworkConfig, clamping some values to ensure they are legal and then pushing it to the Monitor's source channel.

type Options

type Options struct {
	RefreshDelay time.Duration
	MaxIPs       int
}

Jump to

Keyboard shortcuts

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