config

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 6 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
	// Maximum duration for cleanup operations before forcing finalizer removal
	MaxCleanupDuration time.Duration
	// Circuit breaker configuration for AWS operations
	CircuitBreakerEnabled          bool
	CircuitBreakerFailureThreshold int
	CircuitBreakerSuccessThreshold int
	CircuitBreakerTimeout          time.Duration
}

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

func (*ControllerConfig) Validate added in v1.3.2

func (c *ControllerConfig) Validate() error

Validate validates the controller configuration

type ENIManagerConfig

type ENIManagerConfig struct {
	// Node name for this ENI manager instance
	NodeName string
	// 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
	// Default MTU to set on interfaces (0 means use system default)
	DefaultMTU int
	// Map of interface name to MTU value
	InterfaceMTUs map[string]int
	// Enable DPDK device binding
	EnableDPDK bool
	// Default DPDK driver to use for binding (default: vfio-pci)
	DefaultDPDKDriver string
	// Map of interface name to DPDK resource name
	DPDKResourceNames map[string]string
	// Map of PCI address to DPDK bound interface information
	DPDKBoundInterfaces map[string]struct {
		PCIAddress  string
		Driver      string
		NodeENIName string
		ENIID       string
		IfaceName   string
	}
	// Path to DPDK device binding script
	DPDKBindingScript string
	// Path to SRIOV device plugin config file
	SRIOVDPConfigPath string
	// Interface mapping store for persistent mapping between ENI IDs, interface names, and PCI addresses
	InterfaceMappingStore *mapping.InterfaceMappingStore
	// Path to interface mapping store file
	InterfaceMappingStorePath 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

func (*ENIManagerConfig) Validate added in v1.3.2

func (c *ENIManagerConfig) Validate() error

Validate validates the ENI manager configuration

Jump to

Keyboard shortcuts

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