Use 1 traefik instance on 2 VPS

Bonjour,

j'ai un problème de compréhension dans l'utilisation de Traefik.

Voici mon problème :
j'ai actuellement 2 VPS (chez 2 prestataires différents):

  • VPS1 : traefik est installé avec un nom de domaine (guillaume.com par exemple) avec docker et docker-compose et 10 applications qui tournent parfaitement.
  • VPS2 : docker et docker-compose sont installés

Je souhaterai savoir s'il est possible d'utiliser mon instance de Traefik sur mon VPS1 pour accéder à des applications qui se trouvent sur mon VPS2 (si oui comment peut-on faire ?) ou est-il obligé de réinstaller Traefik sur mon VPS2 avec le même nom de domaine guillaume.com ?

J'espère que je suis clair.

D'avance merci pour vos réponses ou suggestions


Hello,

I have a problem of understanding how to use Traefik.

Here is my problem :
I currently have 2 VPS (at 2 different providers):

  • VPS1: traefik is installed with a domain name (guillaume.com for example) with docker and docker-compose and 10 applications running perfectly.
  • VPS2 : docker and docker-compose are installed

I would like to know if it is possible to use my Traefik instance on my VPS1 to access applications that are on my VPS2 (if so how can I do it?) or is it necessary to reinstall Traefik on my VPS2 with the same domain name guillaume.com?

I hope I am clear.

Thanks in advance for your answers or suggestions

If you want to use multiple nodes with Docker, one option is to use Docker Swarm. Make the Traefik node the manager, then Traefik can discover services by label and route to it. You can constraint your services so the containers only run on a certain node.

One alternative is to use a dynamic config with provider.file and manually create routers and services with loadbalancer.server.url.

Another alternative is to use Traefik as reverse proxy on both nodes, just use sub-domains with the different IPs of the nodes. I would always prefer sub-domains over paths anyway, as many webapps can not (easily) be configured with a PathPrefix.