Documentation ¶
Index ¶
Constants ¶
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 ¶
CalculateMaxFreeIPs calculates the maximum free IP quantity based on the Scaler in the passed NodeNetworkConfig. Half of odd batches are rounded up!
func CalculateMinFreeIPs ¶
CalculateMinFreeIPs calculates the minimum free IP quantity based on the Scaler in the passed NodeNetworkConfig. Half of odd batches are rounded up!
func GenerateARMID ¶
func GenerateARMID(nc *v1alpha.NetworkContainer) string
GenerateARMID uses the Subnet ARM ID format to populate the ARM ID with the metadata. If either of the metadata attributes are empty, then the ARM ID will be an empty string.
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
func NewMonitor ¶
func NewMonitor(httpService cns.HTTPService, nnccli nodeNetworkConfigSpecUpdater, cssSource <-chan v1alpha1.ClusterSubnetState, opts *Options) *Monitor
func (*Monitor) GetStateSnapshot ¶
func (pm *Monitor) GetStateSnapshot() cns.IpamPoolMonitorStateSnapshot
GetStateSnapshot gets a snapshot of the IPAMPoolMonitor struct.
func (*Monitor) Start ¶
Start begins the Monitor's pool reconcile loop. On first run, it will block until a NodeNetworkConfig is received (through a call to Update()). Subsequently, it will run run once per RefreshDelay and attempt to re-reconcile the pool.
func (*Monitor) Update ¶
func (pm *Monitor) Update(nnc *v1alpha.NodeNetworkConfig) error
Update ingests a NodeNetworkConfig, clamping some values to ensure they are legal and then pushing it to the Monitor's source channel. If the Monitor has been Started but is blocking until it receives an NNC, this will start the pool reconcile loop. If the Monitor has not been Started, this will block until Start() is called, which will immediately read this passed NNC and start the pool reconcile loop.