Managing multiple networks and servers with traefik and jenkins

Hi, I currently have Traefik installed via docker compose and it manages local apache applications and docker services via dynamic files and docker labels.

now the goal is to move traefik to a management mcchina along with jenkins where, where traefik needs to reach the test machine and prod machine.

is it possible to create 2 separate networks managed by the same traefik instance?
is it possible to manage multiple servers and environments with same traefik instance?
is it possible to manage log rotation and retention without using external tools?

is it possible to integrate traefik with grafana, loki, prometheus and/or checkmk for direct log reading and service monitoring?

Thanks

You can connect Traefik to multiple Docker networks to keep environments kind of separated.

Use docker.network in labels when the target service is attached to multiple networks (of which not all are shared with Traefik).

You can connect multiple servers. Use Docker Swarm for overlay network and automatic configuration discovery across nodes. Or setup routers/services manually in dynamic config file, loaded with providers.file.

You can limit logs for example by setting size and file count when using Docker standard out. But for real log rotation you need tools like logrotate.

Of course you can use agents to read Docker logs or file logs into Loki, Traefik also can provide metrics.

Warning: with a single Traefik you can break your production system from the test system. The test system could use wrong Host() and it could overwrite production Traefik router/service names and config.

Hi, thank you for your reply, could you provide some more details with example of conf?

at the moment the traefik server, is present under the mgmt network 10.10.0.0/24, the prod server is under the prod network 10.20.0.0/24 and the test server is under the test network 10.0.30.0/24

so they are 3 different networks where on each machine there are local apache services and docker and docker-compose services, no docker swarm is used.

how can i configure the metrics?
Can I use the monitoring api with the open source version?

Thanks

Are you using Docker networks or just Traefik in Docker?

Traefik doc is your friend, see metrics.

at the moment on the production server where both traefik and prod apps are, I have created a docker network on purpose of bridge type and scope local, but with the moving of traefik, I think I need to change network type.
suggestions?