Traefik Auto-Discovers Services in Docker and Kubernetes
Nginx needs manual config updates every time you add a service. Traefik watches your Docker containers and Kubernetes pods — routes traffic automatically.
What Makes Traefik Special
- Auto-discovery — detects new containers/pods automatically
- Lets Encrypt — automatic TLS certificates
- Middleware — rate limiting, auth, headers, compression
- Load balancing — round-robin, weighted, sticky sessions
- Dashboard — real-time traffic visibility
- Multi-provider — Docker, K8s, Consul, file
Docker Compose Example
services:
traefik:
image: traefik:v3.0
command:
- --providers.docker=true
- --entrypoints.web.address=:80
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
app:
image: myapp:latest
labels:
- traefik.http.routers.app.rule=Host(`app.example.com`)
Add a new service with labels — Traefik picks it up instantly.
Traefik vs Nginx
| Feature | Traefik | Nginx |
|---|---|---|
| Auto-discovery | Yes | No |
| Docker native | Labels | Config files |
| Lets Encrypt | Built-in | Certbot |
| Dashboard | Built-in | Third-party |
| Hot reload | Yes | Signal |
Why Traefik
- Zero-config routing — labels on containers = done
- Auto TLS — certificates managed automatically
- Cloud-native — built for Docker and Kubernetes
- Middleware — auth, rate limiting in one line
📧 spinov001@gmail.com — Infrastructure consulting
Follow for more DevOps tool reviews.
Top comments (0)