amazon-ecs-agent icon indicating copy to clipboard operation
amazon-ecs-agent copied to clipboard

Add support for Custom Network and Network Alias settings

Open jsuchenia opened this issue 1 year ago • 4 comments

Summary

Add support for Custom Network and Network Alias settings. It's useful when running more that two containers that should communicate via local network.

Implementation details

This patch provide two new configuration variables:

  • ECS_OVERRIDE_BRIDGE_NETWORK_NAME - when set, all containers created with NetworkType bridge will be set to this network name. This is equivalent of --net <name> parameter of docker run command
  • ECS_ADD_CONTAINER_NAME_AS_NETWORK_ALIAS - when set to true, and when container is using custom network - then container name will be assigned as a network alias. This is equivalent of --network-alias <container-name> parameter of docker run command.

Testing

New tests cover the changes: no

Description for the changelog

Enhancement - Create containers in a custom network and register their name as network alias

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

jsuchenia avatar Jul 10 '23 14:07 jsuchenia

@fierlion I've fixed tests - now they should pass, however do not cover a new functionality

jsuchenia avatar Jul 10 '23 19:07 jsuchenia

Thanks for the PR, however this is not a bug fix but an entirely new feature request. It has to go through proper channels before any CRs. Please hold.

ofiliz avatar Jul 13 '23 03:07 ofiliz

Thanks for the PR, however this is not a bug fix but an entirely new feature request. It has to go through proper channels before any CRs. Please hold.

I've never marked it as a bugfix - we maintain this patch for our purposes, and I asked our Account Manager if we can propose it as a change. AFAIK your team should get a separate email/message about it.

We use this functionality. with ECS Anywhere aka External service.

jsuchenia avatar Jul 13 '23 09:07 jsuchenia