question

DanielHillebrand-1695 avatar image
0 Votes"
DanielHillebrand-1695 asked DanielHillebrand-1695 answered

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

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

srbose-msft avatar image
0 Votes"
srbose-msft answered DanielHillebrand-1695 commented

@DanielHillebrand-1695 , 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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@srbose-msft, thanks for answering. I only included the hostname information to provide some background/additional information.

The real problem is that name resolution as advertised via /etc/hosts is broken and my containers cannot talk to each other.

Good suggestion though opening a support request. Will do that.

0 Votes 0 ·

After re-reading your answer let me kindly point out that it was not related at all to my problem regarding /etc/hosts.

I have deleted my comment with the hostname-screenshot as it might suggest I am concerned about the difference in hostnames.

tl;dr My problem: IP resolution via shared /etc/hosts broken. Details in my question above.

0 Votes 0 ·
DanielHillebrand-1695 avatar image
1 Vote"
DanielHillebrand-1695 answered

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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.