The ECS Bridge plugin configures the network namespace of the container to be able to communicate with the credentials endpoint of the ECS Agent by creating a bridge (if required) and veth pair to connect the container's network namespace to the bridge. An example configuration for invoking this plugin is listed next:
{
"type":"ecs-bridge",
"cniVersion":"0.3.0",
"bridge":"ecs-br0",
"mtu":1500,
"ipam":{
"type":"ecs-ipam",
"id":"test",
"cniVersion":"0.3.0",
"ipv4-subnet":"169.254.172.0/22",
"ipv4-routes":[
{
"dst":"169.254.172.1"
}
]
}
}
bridge
(string, required): the name of the bridgeipam
(ipam config, required): the ipam configuration to use, refer to ../ipam/README.md for more detailsmtu
(int, optional): the maximum transmission unit size for the bridge
Please ensure that the environment variables needed for running any CNI plugins are appropriately configured:
CNI_COMMAND
: Command to execute eg: ADD.CNI_PATH
: Plugin binary path eg:pwd
/bin.CNI_IFNAME
: Interface name inside the container
export CNI_COMMAND=ADD && cat mynet.conf | ../bin/ecs-bridge
export CNI_COMMAND=DEL && cat mynet.conf | ../bin/ecs-bridge
mynet.conf
is the configuration file for the plugin, it's the same as described
in the overview above.
The end-to-end test suite for this package makes the following assumptions:
- The
ecs-bridge
andecs-ipam
plugin executables have been built - The
CNI_PATH
environment variable points to the location of these plugins - The test is being executed with
root
user privileges
Since these tests invoke the the ECS Bridge plugin as if an end user such as the ECS Agent is invoking it, additional configuration variables can be set to prevent the test runner from cleaning up the artifacts generated during the test execution for debugging purposes:
ECS_PRESERVE_E2E_TEST_LOGS
: This is set tofalse
by default. Overriding withtrue
preserves log files from the pluginsECS_BRIDGE_PRESERVE_IPAM_DB
: This is set tofalse
by default. Overriding withtrue
preserves the IPAM database generated by the ECS IPAM plugin
Please refer the Makefile for an example of the command line required to
run end-to-end tests (under the e2e-test
target).