config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WorkQueueDefaultMaxRetries = 5

	// Default Configuration for Pod ENI resource type
	PodENIDefaultWorker = 2

	// Default Configuration for IPv4 resource type
	IPv4DefaultWorker  = 2
	IPv4DefaultWPSize  = 3
	IPv4DefaultMaxDev  = 1
	IPv4DefaultResSize = 0

	// EC2 API QPS for user service client
	UserServiceClientQPS      = 6
	UserServiceClientQPSBurst = 8

	// EC2 API QPS for instance service client
	InstanceServiceClientQPS   = 2
	InstanceServiceClientBurst = 3

	// API Server QPS
	DefaultAPIServerQPS   = 10
	DefaultAPIServerBurst = 15
)
View Source
const (
	// VPCResourcePrefix is the common prefix for all VPC extended resources
	VPCResourcePrefix = "vpc.amazonaws.com/"
	// ResourceNamePodENI is the extended resource name for Branch ENIs
	ResourceNamePodENI = VPCResourcePrefix + "pod-eni"
	// ResourceNameIPAddress is the extended resource name for private IP addresses
	ResourceNameIPAddress = VPCResourcePrefix + "PrivateIPv4Address"
)

K8s Pod Annotations

View Source
const (
	// ControllerName is the name of the VPC Resource Controller
	ControllerName = "vpc-resource-controller"
	// HasTrunkAttachedLabel is the label denoting that the trunk ENI is attached to node or not
	HasTrunkAttachedLabel = "vpc.amazonaws.com/has-trunk-attached"
	// CustomNetworkingLabel is the label with the name of ENIConfig to be used by the node for custom networking
	CustomNetworkingLabel = "vpc.amazonaws.com/eniConfig"
	// NodeLabelOS is the Kubernetes Operating System label
	NodeLabelOS = "kubernetes.io/os"
	// NodeLabelOS is the Kubernetes Operating System label used before k8s version 1.16
	NodeLabelOSBeta = "beta.kubernetes.io/os"
	// OSWindows is the the windows Operating System
	OSWindows = "windows"
	// OSLinux is the the linux Operating System
	OSLinux = "linux"
)

K8s Pod Labels

View Source
const (
	ControllerTagPrefix = "vpcresources.k8s.aws/"
	VLandIDTag          = ControllerTagPrefix + "vlan-id"
	TrunkENIIDTag       = ControllerTagPrefix + "trunk-eni-id"

	ClusterNameTagKeyFormat = "kubernetes.io/cluster/%s"
	ClusterNameTagValue     = "owned"

	NetworkInterfaceOwnerTagKey         = "eks:eni:owner"
	NetworkInterfaceOwnerTagValue       = "eks-vpc-resource-controller"
	NetworkInterfaceOwnerVPCCNITagValue = "amazon-vpc-cni"
)

EC2 Tags

View Source
const (
	LeaderElectionKey       = "cp-vpc-resource-controller"
	LeaderElectionNamespace = "kube-system"
	VpcCniConfigMapName     = "amazon-vpc-cni"
	EnableWindowsIPAMKey    = "enable-windows-ipam"
	// Since LeaderElectionNamespace and VpcCniConfigMapName may be different in the future
	KubeSystemNamespace            = "kube-system"
	VpcCNIDaemonSetName            = "aws-node"
	OldVPCControllerDeploymentName = "vpc-resource-controller"
)

Variables

View Source
var (
	// CoolDownPeriod is the time to let kube-proxy propagates IP tables rules before assigning the resource back to new pod
	CoolDownPeriod = time.Second * 30
	// ENICleanUpInterval is the time interval between each dangling ENI clean up task
	ENICleanUpInterval = time.Minute * 30
)

Functions

func LoadResourceConfig

func LoadResourceConfig() map[string]ResourceConfig

LoadResourceConfig returns the Resource Configuration for all resources managed by the VPC Resource Controller. Currently returns the default resource configuration and later can return the configuration from a ConfigMap.

Types

type ResourceConfig

type ResourceConfig struct {
	// Name is the unique name of the resource
	Name string
	// WorkerCount is the number of routines that will process items for the buffer
	WorkerCount int
	// SupportedOS is the map of operating system that supports the resource
	SupportedOS map[string]bool
	// WarmPoolConfig represents the configuration of warm pool for resources that support warm resources. Optional
	WarmPoolConfig *WarmPoolConfig
}

ResourceConfig is the configuration for each resource type

type WarmPoolConfig

type WarmPoolConfig struct {
	// Number of resources to keep in warm pool per node
	DesiredSize int
	// Number of resources not to use in the warm pool
	ReservedSize int
	// The maximum number by which the warm pool can deviate from the desired size
	MaxDeviation int
}

WarmPoolConfig is the configuration of Warm Pool of a resource

Jump to

Keyboard shortcuts

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