When testing the new 2.89.15 release of Balena I came across a container networking issue: I can’t ping certain containers by their name, although DNS resolution and pinging by IP work fine.
We’re using a multi-container setup in our fleet of UpBoards running balena. Some of these containers run a kafka stack, e.g. the cp-zookeeper image.
I noticed that the confluent containers couldn’t connect to each other, which I could reproduce by not being able to ping the confluent containers by their name. Apparently this works fine on the old 2.68 Balena version.
I simplified the issue but looking up the base image used (Redhat ubi8) and was able to generate a simple docker-compose.yml to reproduce this issue:
version: "2.1" services: test1: image: balenalib/intel-nuc-ubuntu:bionic entrypoint: ["tail", "-f", "/dev/null"] container_name: test1 test2: image: balenalib/intel-nuc-ubuntu:bionic entrypoint: ["tail", "-f", "/dev/null"] container_name: test2 zookeeper: image: registry.access.redhat.com/ubi8/ubi-minimal entrypoint: ["tail", "-f", "/dev/null"] container_name: zookeeper
I can ping the containers test1 and test2 from each other but I cannot ping zookeeper by hostname. The DNS seems to be resolved correctly and ping by IP works, however ping by hostname doesn’t (only get report of one package after stopping it with ctrl+c).
root@37df5e0c5fe5:/# nslookup zookeeper
root@37df5e0c5fe5:/# ping zookeeper
PING zookeeper (172.17.0.2) 56(84) bytes of data.
^C64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.229 ms
— zookeeper ping statistics —
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.229/0.229/0.229/0.000 ms
root@37df5e0c5fe5:/# ping 172.17.0.2
PING 172.17.0.2 (172.17.0.2) 56(84) bytes of data.
64 bytes from 172.17.0.2: icmp_seq=1 ttl=64 time=0.259 ms
64 bytes from 172.17.0.2: icmp_seq=2 ttl=64 time=0.196 ms
Notice the “^C” before the printout in the second command. I’ve never seen this behavior of the ping command before.
I’m looking for advice on how to pinpoint the issue. If useful I can upload further information (balena inspect of the container or so).