platform

package
v0.0.0-...-b702281 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ECSSubNet     = "169.254.172.0/22"
	AgentEndpoint = "169.254.170.2/32"

	CNIPluginLogFileEnv    = "ECS_CNI_LOG_FILE"
	VPCCNIPluginLogFileEnv = "VPC_CNI_LOG_FILE"
	IPAMDataPathEnv        = "IPAM_DB_PATH"
)
View Source
const (
	// CNIPluginPathDefault is the directory where CNI plugin binaries are located.
	CNIPluginPathDefault = "/usr/local/bin"

	// ENISetupTimeout is the maximum duration that ENI manager waits before aborting ENI setup.
	ENISetupTimeout = 1 * time.Minute

	BridgePluginName         = "ecs-bridge"
	ENIPluginName            = "ecs-eni"
	IPAMPluginName           = "ecs-ipam"
	AppMeshPluginName        = "aws-appmesh"
	ServiceConnectPluginName = "ecs-serviceconnect"

	VPCBranchENIPluginName = "vpc-branch-eni"

	VPCBranchENIInterfaceTypeVlan = "vlan"
	VPCBranchENIInterfaceTypeTap  = "tap"

	VPCTunnelPluginName = "vpc-tunnel"

	VPCTunnelInterfaceTypeGeneve = "geneve"
	VPCTunnelInterfaceTypeTap    = "tap"

	BridgeInterfaceName = "fargate-bridge"

	IPAMDataFileName = "eni-ipam.db"
)
View Source
const (
	// Identifiers for each platform we support.
	WarmpoolDebugPlatform    = "ec2-debug-warmpool"
	FirecrackerDebugPlatform = "ec2-debug-firecracker"
	WarmpoolPlatform         = "warmpool"
	FirecrackerPlatform      = "firecracker"
)
View Source
const (
	HostsLocalhostEntry = "127.0.0.1 localhost"

	// DNS related configuration.
	HostnameFileName    = "hostname"
	ResolveConfFileName = "resolv.conf"
	HostsFileName       = "hosts"
)

Variables

This section is empty.

Functions

func NewTunnelConfig

func NewTunnelConfig(
	netNSPath string,
	iface *networkinterface.NetworkInterface,
	ifType string,
) ecscni.PluginConfig

NewTunnelConfig creates a new vpc-tunnel CNI plugin configuration.

Types

type API

type API interface {
	// BuildTaskNetworkConfiguration translates network data in task payload sent by ACS
	// into the task network configuration data structure internal to the agent.
	BuildTaskNetworkConfiguration(
		taskID string,
		taskPayload *ecsacs.Task) (*tasknetworkconfig.TaskNetworkConfig, error)

	// CreateNetNS creates a network namespace with the specified path.
	CreateNetNS(netNSPath string) error

	// DeleteNetNS deletes the specified network namespace.
	DeleteNetNS(netNSPath string) error

	// CreateDNSConfig creates the following DNS config files depending on the
	// network namespace configuration:
	// 1. resolv.conf
	// 2. hosts
	// 3. hostname
	// These files are then copied into desired locations so that containers will
	// have access to the accurate DNS configuration information.
	CreateDNSConfig(taskID string, netNS *tasknetworkconfig.NetworkNamespace) error

	// DeleteDNSConfig deletes the directory at /etc/netns/<netns-name> and all its files.
	DeleteDNSConfig(netNSName string) error

	// GetNetNSPath returns the path of a network namespace.
	GetNetNSPath(netNSName string) string

	// ConfigureInterface configures an interface inside a network namespace
	// for it to be able to serve traffic.
	ConfigureInterface(
		ctx context.Context,
		netNSPath string,
		iface *networkinterface.NetworkInterface,
		netDAO netlibdata.NetworkDataClient,
	) error

	// ConfigureAppMesh configures AppMesh specific rules inside the task network namespace
	// to enable the AppMesh feature.
	ConfigureAppMesh(ctx context.Context, netNSPath string, cfg *appmesh.AppMesh) error

	// ConfigureServiceConnect configures Service Connect specific rules inside the task network namespace
	// to enable the ServiceConnect feature.
	ConfigureServiceConnect(
		ctx context.Context,
		netNSPath string,
		primaryIf *networkinterface.NetworkInterface,
		scConfig *serviceconnect.ServiceConnectConfig,
	) error
}

API declares a set of methods that requires platform specific implementations.

func NewPlatform

func NewPlatform(
	platformString string,
	volumeAccessor volume.TaskVolumeAccessor,
	stateDBDirectory string,
	netWrapper netwrapper.Net,
) (API, error)

NewPlatform creates an implementation of the platform API depending on the platform type where the agent is executing.

Directories

Path Synopsis
Package mock_platform is a generated GoMock package.
Package mock_platform is a generated GoMock package.

Jump to

Keyboard shortcuts

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