lhaig / nomad-traefik

Published by Lance Haig | Raw HCL

job
0 stars
Description
Traefik proxy
License
MPL-2.0
Tags
#proxy #loadbalancer
Versions
Select a version to see its documentation and run command.
Quick Run (v0.0.1)
ramble job run lhaig/nomad-traefik@v0.0.1
README
# Traefik A modern reverse proxy and load balancer for Nomad with native service discovery. ## Overview This job deploys [Traefik](https://traefik.io/) as a system job, running one instance on each Nomad client node. Traefik automatically discovers services registered with Nomad and routes traffic to them. ## Requirements - Docker driver enabled on Nomad clients - Ports 80, 443, and 8081 available on host ## Usage ```bash nomad job run traefik.nomad.hcl ``` With custom variables: ```bash nomad job run \ -var="http_port=8080" \ -var="enable_dashboard=true" \ traefik.nomad.hcl ``` ## Variables | Name | Description | Default | |------|-------------|---------| | `datacenters` | List of datacenters to deploy to | `["dc1"]` | | `traefik_version` | Traefik Docker image tag | `v3.0` | | `http_port` | Port for HTTP traffic | `80` | | `https_port` | Port for HTTPS traffic | `443` | | `api_port` | Port for Traefik API/Dashboard | `8081` | | `nomad_address` | Nomad HTTP address for discovery | `http://127.0.0.1:4646` | | `enable_dashboard` | Enable the Traefik dashboard | `true` | | `log_level` | Log level (DEBUG, INFO, WARN, ERROR) | `INFO` | | `service_provider` | Service discovery provider | `nomad` | ## Service Registration To route traffic to your services, add Traefik tags to your Nomad service: ```hcl service { name = "my-app" port = "http" provider = "nomad" tags = [ "traefik.enable=true", "traefik.http.routers.my-app.rule=Host(`myapp.example.com`)", ] } ``` ## Dashboard When enabled, the Traefik dashboard is available at `http://<node-ip>:8081/dashboard/` ## License MPL 2.0