config

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: May 11, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration management for the AWS Multi-ENI Controller and ENI Manager components.

This package handles loading configuration from environment variables and command-line flags, providing sensible defaults when values are not explicitly provided. It supports configuration for both the controller (which runs in Kubernetes) and the ENI manager (which runs on each node).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerConfig

type ControllerConfig struct {
	// AWS Region to use for API calls
	AWSRegion string
	// Reconciliation period for checking ENI status
	ReconcilePeriod time.Duration
	// Timeout for ENI detachment operations
	DetachmentTimeout time.Duration
	// Maximum concurrent reconciles
	MaxConcurrentReconciles int
	// Default device index if not specified in NodeENI
	DefaultDeviceIndex int
	// Default delete on termination setting
	DefaultDeleteOnTermination bool
	// Maximum number of concurrent ENI cleanup operations
	MaxConcurrentENICleanup int
}

ControllerConfig holds configuration for the ENI controller

func DefaultControllerConfig

func DefaultControllerConfig() *ControllerConfig

DefaultControllerConfig returns the default configuration for the controller

func LoadControllerConfig

func LoadControllerConfig() (*ControllerConfig, error)

LoadControllerConfig loads controller configuration from environment variables

type ENIManagerConfig

type ENIManagerConfig struct {
	// Interval between interface checks
	CheckInterval time.Duration
	// Primary interface name to ignore (if empty, will auto-detect)
	PrimaryInterface string
	// Enable debug logging
	DebugMode bool
	// Timeout for interface to come up after configuration
	InterfaceUpTimeout time.Duration
	// Regex pattern to identify ENI interfaces
	ENIPattern string
	// List of interfaces to ignore
	IgnoreInterfaces []string
}

ENIManagerConfig holds configuration for the ENI manager

func DefaultENIManagerConfig

func DefaultENIManagerConfig() *ENIManagerConfig

DefaultENIManagerConfig returns the default configuration for the ENI manager

func LoadENIManagerConfigFromFlags

func LoadENIManagerConfigFromFlags(checkInterval *time.Duration, primaryIface *string, debugMode *bool, eniPattern *string, ignoreList *string) *ENIManagerConfig

LoadENIManagerConfigFromFlags loads ENI manager configuration from command-line flags This is used by the ENI manager component

Jump to

Keyboard shortcuts

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