Home > Back-end >  Connection refused when using "curl" to whoami with traefik in Docker, anyone know how to
Connection refused when using "curl" to whoami with traefik in Docker, anyone know how to

Time:09-05

Update

when I run the command to the rejected service sudo docker ps --no-trunced SERVICE_NAME, I got the following:

network sandbox join failed: subnet sandbox join failed for "10.0.2.0/24": error creating vxlan interface: operation not supported.

I checked from the web that this is a kernel problem but my kernel version is already at 5.15, which for the case of arm64 its the latest, are there any alternatives?


I am pretty new to docker, recently I would like to setup a traefik container to proxy all containers within the docker so that TLS can be used.

I followed the tutorial on enter image description here

The logs are not available for some unknown reason, from the portainer interface it seems whoami is running, but traefik seems to be offline, or rejecting all connections.

Does anyone know why and how can I solve this? Thank you very much in advance!

One more thing, the underlying system:

OS: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-1013-raspi aarch64)
Device: Raspberry Pi 4B
CPU architecture: Aarch64
RAM: 4GB

CodePudding user response:

Traefik needs access to the docker daemon (running on host) in order to monitor containers going up or stopping.

In the tutorial you (partially) followed that link is achieved by providing the traefik container with a link to the socket proxy. Since you left that part out, there is now no way for Traefik to talk to docker.

From the tutorial:

--providers.docker.endpoint=tcp://socket_proxy:2375

Instead of connecting directly to unix:///var/run/docker.sock we are going to use the socket_proxy container to be able to query the Docker endpoint as a security precaution.

If you don't like the proxy solution (which is actually not bad), you can use the less secure option of mapping the host /var/run/docker.sock to the same path inside the container.

volumes:
  - "/var/run/docker.sock:/var/run/docker.sock"

You can also see an example of this in the official documentation

CodePudding user response:

For the problem I have mentioned which the services of the stack is rejected or unable to start:

network sandbox join failed: subnet sandbox join failed for "10.0.2.0/24": error creating vxlan interface: operation not supported

I am able to get it working after applying the following fix:

  1. Check if vxlan driver exists in the kernel with modprobe vxlan
  2. If vxlan does not exist, which is the common case for Ubuntu on Raspberry Pi, details on Mail archive
  3. From this mail archive they suggest that a package named linux-modules-extra-raspi contains all missing modules for Ubuntu on Raspberry Pi.
  4. Install this package using sudo aptitude install linux-modules-extra-raspi -y
  5. Insert the driver vxlan by modprobe vxlan (I don't know whether this step is needed, please correct me if its not correct)
  • Related