# 二进制 ## 下载 ```bash wget https://github.com/containous/traefik/releases/download/v1.7.9/traefik_linux-amd64 curl -k -o traefik.toml https://raw.githubusercontent.com/containous/traefik/master/traefik.sample.toml chmod +x traefik_linux-amd64 ./traefik_linux-amd64 --configFile=traefik.toml ``` ## 配置 ### 修改80端口 ```toml [entryPoints] [entryPoints.http] address=":8090" ``` ### 修改8080端口 ```toml [entryPoints] [entryPoints.traefik] address=":8091" [metrics] [metrics.prometheus] entryPoint = "traefik" buckets = [0.1,0.3,1.2,5.0] # http://127.0.0.1:8091/dashboard/ # curl http://127.0.0.1:8091/metrics # curl http://127.0.0.1:8091/health ``` ### systemd * [systemd Service Unit for Traefik](https://gist.github.com/ubergesundheit/7c9d875befc2d7bfd0bf43d8b3862d85) # k8s ```bash # examples/k8s/traefik-rbac.yaml kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-rbac.yaml # examples/k8s/traefik-deployment.yaml kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-deployment.yaml # examples/k8s/traefik-ds.yaml #kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-ds.yaml kubectl --namespace=kube-system get pod,svc -o wide # examples/k8s/ui.yaml kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/ui.yaml # 测试traefik-ui curl -H 'host:traefik-ui.minikube' http://: curl -H 'host:traefik-ui.minikube' http://: curl -H 'host:traefik-ui.minikube' http://: # Found ``` # 参考 * [releases](https://github.com/containous/traefik/releases) * [user-guide](https://docs.traefik.io/user-guide/kubernetes/)