Reverse Proxy Server
Traefik ..
Last updated
Traefik ..
Last updated
Traefik is a modern HTTP reverse proxy and load balancer that simplifies deploying microservices. It automatically discovers the right configuration for your services based on the infrastructure it runs on, whether it's Docker, Kubernetes, Marathon, Consul, Etcd, Rancher, or others.
Traefik makes routing your services easy with its user-friendly dashboard, enabling real-time updates without restarting. Its native support for Let's Encrypt allows for automatic SSL/TLS certificate generation and renewal, enhancing security.
Where traditionally edge routers (or reverse proxies) need a configuration file that contains every possible route to your services, Traefik gets them from the services themselves.
Deploying your services, you attach information that tells Traefik the characteristics of the requests the services can handle.
It means that when a service is deployed, Traefik detects it immediately and updates the routing rules in real time. Similarly, when a service is removed from the infrastructure, the corresponding route is deleted accordingly.
You no longer need to create and synchronize configuration files cluttered with IP addresses or other rules.
For futher information:
By default the Traefik dashboard is disabled.
The configuration settings are located in: docker-compose.in.yml
The IP address for the
To enable the dashboard, navigate to:
cd
cd /opt/pentaho/pdc-docker-deployment/vendor
sudo nano docker-compose.in.yml
Uncomment the dashboard port.
# The Web UI (enabled by --api.insecure=true)
- "8181:8080"
Restart the PDC services.
cd
cd /opt/pentaho/pdc-docker-deployment
./pdc.sh stop
cd
cd /opt/pentaho/pdc-docker-deployment
./pdc.sh up
Ensure the required services are up and running.
Log into Portainer and make a note of the IP address: port for the Traefik container.
Enter: [IP address: Port] in your browser.
Traefik simplifies the routing of requests to services by dynamically obtaining routing rules directly from the services themselves, rather than relying on a static configuration file.
When a service is deployed or removed, Traefik automatically detects the change and updates its routing rules in real-time to reflect the current state of the infrastructure, ensuring seamless access to your services without the need to manage complex configuration files.
Traefik allows you to route traffic using labels. This solution allows for all your apps to run without explicit exposing ports, you just let Traefik know what port it should forward requests to and where it should send those requests to - a particular app (Rule).
Navigate to: /opt/pentaho/pdc-docker-deployment/vendor
Double-click on: docker-compose.in.yml to open the text file
Notice there's a whole bunch of labels & rules that are redirecting requests.
Below is an extract for the fe: (front-end).
fe:
labels:
- "traefik.enable=true"
- "traefik.docker.network=${COMPOSE_PROJECT_NAME}_default"
- "traefik.http.services.${COMPOSE_PROJECT_NAME}_fe.loadbalancer.server.port=3000"
- "traefik.http.routers.fe.rule=PathPrefix(`/`)"
- "traefik.http.routers.fe.entrypoints=web"
- "traefik.http.routers.fes.rule=PathPrefix(`/`)"
- "traefik.http.routers.fes.tls=true"
- "traefik.http.routers.fes.entrypoints=web-secure"
- "traefik.port=3000"
Brief overview:
• App / Service is called: fe (front-end)
• Any HTTP / HTTPS request will be routed to this fe app loadbalancer on port:3000
In the Traefik dashboard, select HTTP option in top menu.
Lots of info can also be found in Portainer.