job "traefik" { datacenters = ["dc1"] type = "service" update { max_parallel = 1 min_healthy_time = "10s" healthy_deadline = "3m" auto_revert = true } group "traefik" { count = 1 # 先在warden节点部署一个实例 # 约束只在warden节点运行 constraint { attribute = "${node.unique.name}" operator = "=" value = "bj-warden" } restart { attempts = 3 interval = "30m" delay = "15s" mode = "fail" } network { port "http" { static = 80 } port "https" { static = 443 } port "api" { static = 8080 } } task "traefik" { driver = "exec" # 下载Traefik v3二进制文件 artifact { source = "https://github.com/traefik/traefik/releases/download/v3.1.5/traefik_v3.1.5_linux_amd64.tar.gz" destination = "local/" mode = "file" options { archive = "true" } } # 动态配置文件模板 template { data = <