No entries in shared /etc/hosts when having > 4 containers in a container group?

Daniel Hillebrand 6 Reputation points
2021-10-16T11:10:31.87+00:00

My setup of 6 containers depends on the IP resolution via hostname for inter-container communication. But it is not working when having more than 4 containers, deployed as a container group to ACI.

I have tested with >= 4 containers and checked the /etc/hosts: Correct entries for all containers created with their hostname there. Good.

When testing with > 4 containers I have to add resource reservation entries to my docker-compose.yml to stay below the 4 core limit of ACI. I can deploy the whole group of 6 containers successfully but there are not container name entries created in /etc/hosts.

Used region for tests: West US

Differences I noted in both cases, connecting to the container (bash)
<= 4 containers:

  • The hostname starts with "SandboxHost-...."
  • uname -a -> "Linux SandboxHost-637699780050910076 5.4.81-microsoft-standard #1 SMP Thu Dec 3 23:47:24 UTC 2020 x86_64 GNU/Linux"

4 containers

  • The hostname starts with "wk-caas-...."
  • uname -a -> "4.15.0-1113-azure #126~16.04.1-Ubuntu SMP Tue Apr 13 16:55:24 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux"

Strange fact: I also got a failing container group (wk-caas) with 2 containers using region West Europe. Not sure if that's reproducable.

I have invested many hours into this issues trying lots of stuff and making sure it is not my fault. I am increasingly convinced that this is a bug in ACI that someone needs to have a look at.

I have tried deployment with both docker compose ACI integration and also YAML file with az container.

Any help/tips highly appreciated!
Daniel

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
633 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Daniel Hillebrand 6 Reputation points
    2021-10-22T08:54:42.04+00:00

    Update: Problem seems to be fixed now. I have not received a feedback from the Azure folks, but I am now getting the hosts where hostname begins with "SandboxHost" everytime, independent of container count.

    So I guess it is either coincidence or the Azure folks have stopped deploying to the "wk-caas" hosts for ACI deployments.

    If this starts happening again: I have a workaround prepared where I create the entries in /etc/hosts myself, just adding a line for each container like the automatically run "aci--dns--sidecar" container would do.

    1 person found this answer helpful.
    0 comments No comments

  2. SRIJIT-BOSE-MSFT 4,326 Reputation points Microsoft Employee
    2021-10-18T05:41:30.95+00:00

    @Daniel Hillebrand , thank you for your question.

    These variations in hostnames of the containers are caused as a result of how the containers are orchestrated under the hood and on what underlying infrastructure they end up in. Since ACI is a serverless offering, the underlying infrastructure is abstracted from the customers. For further information on this, the best course of action would be to open a Microsoft Technical Support Request.

    ----------

    Hope this helps.

    Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.