Traefik Notes
Key Concepts
- Reverse Proxy: Routes client requests to backend services.
- Dynamic Configuration: Automatically updates routing rules as services change.
Core Components
Entrypoints
Network entry points where Traefik listens for incoming requests.
Routers
Connect incoming requests to services based on defined rules.
Services
Define how to reach backend services that process requests.
Middlewares
Modify requests or responses, adding functionalities like authentication or rate limiting.
Configuration Settings
Static Configuration
Foundational settings that remain constant:
- EntryPoints
- Providers
- API Dashboard
Set through:
- Configuration files
- Command-line arguments
- Environment variables
Dynamic Configuration
Settings that can be modified on-the-fly:
- Routing rules
- Middleware configurations
- SSL certificate management
Use Cases
- Microservices Architectures
- Continuous Deployment
Common Labels
Port Configuration
Tells Traefik which port to forward requests to within the container.
Router Rule
Defines conditions for routing requests to a specific service.
Enable Traefik for a Service
Instructs Traefik to include this container in its routing.
Middleware Application
Applies a middleware to a specific router.
Troubleshooting
- Check Traefik logs for routing issues.
- Verify container health and accessibility.
- Ensure labels are correctly defined in Docker Compose.
- Confirm network connectivity between Traefik and services.