Traefik role
Deploy Traefik v3 as a modern HTTP reverse proxy and load balancer with automatic HTTPS certificate management.
Usage
Configure Traefik in your inventory:
1 2 | |
Include the role in your playbook:
1 2 3 4 | |
The role provides these tags:
- traefik-install - Deploy Traefik with configuration files
- traefik-uninstall - Remove Traefik container and configuration
- traefik-update - Update Traefik to latest version
- traefik-pull - Pull latest Traefik image
Docs
Deploy Traefik to your Docker host:
1 | |
Update Traefik to the latest version:
1 | |
Remove Traefik installation:
1 | |
Configuration Details
The role deploys Traefik v3.6.1 with:
- Automatic HTTPS: Uses Cloudflare DNS challenge for Let's Encrypt certificates
- Docker Integration: Automatic service discovery via Docker socket
- Configuration Files:
- traefik.yaml - Main Traefik configuration
- config.yaml - Dynamic configuration
- acme.yaml - Certificate resolver configuration
- Security: no-new-privileges security option enabled
- Persistent Logs: Local volume for access and error logs
Network Configuration
- Ports Exposed:
80- HTTP entrypoint (with automatic HTTPS redirect)443- HTTPS entrypoint- Network: Creates and uses external
proxynetwork for service communication
Dashboard Access
The Traefik dashboard is available at:
- URL: https://traefik.rwcloud.ch
- Authentication: Currently disabled (commented out in labels)
To enable basic authentication, uncomment these labels and set credentials:
1 2 | |
Certificate Management
Traefik automatically manages Let's Encrypt certificates using:
- Cert Resolver: Cloudflare DNS challenge
- Wildcard Support: Configured for *.rwcloud.ch
- Main Domain: rwcloud.ch
- Provider: Infomaniak API token for DNS updates
Files Created
The role creates these files on the host:
- /docker/traefik/traefik.yaml - Main configuration
- /docker/traefik/config.yaml - Dynamic routing rules
- /docker/traefik/acme.yaml - ACME certificate settings
