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" ManagedPlatform = "managed-instance" ManagedDebugPlatform = "ec2-debug-managed-instance" )
View Source
const ( HostsLocalhostEntryIPv4 = "127.0.0.1 localhost" HostsLocalhostEntryIPv6 = "::1 localhost" // DNS related configuration. HostnameFileName = "hostname" ResolveConfFileName = "resolv.conf" HostsFileName = "hosts" )
View Source
const ( MacResource = "mac" IPv4SubNetCidrBlock = "network/interfaces/macs/%s/subnet-ipv4-cidr-block" IPv6SubNetCidrBlock = "network/interfaces/macs/%s/subnet-ipv6-cidr-blocks" PrivateIPv4Address = "local-ipv4" PrivateIPv6Address = "ipv6" InstanceIDResource = "instance-id" DefaultArg = "default" NetworkInterfaceDeviceName = "eth1" // default network interface name in the task network namespace. )
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)
// HandleHostMode returns error if host mode is not enabled for the platform.
HandleHostMode() 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( platformConfig Config, 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.
type Config ¶
type Config struct {
// Name specifies which platform to use (Linux, Windows, ec2-debug, etc).
Name string
// ResolvConfPath specifies path to resolv.conf file for DNS config.
// Different platforms may have different paths for this file.
ResolvConfPath string
}
Config contains platform-specific data.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.