traefik
文章目录
二进制
下载
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端口
[entryPoints]
[entryPoints.http]
address=":8090"
修改8080端口
[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
k8s
# 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://<node-ip>:<nodeport>
curl -H 'host:traefik-ui.minikube' http://<CLUSTER-IP>:<port>
curl -H 'host:traefik-ui.minikube' http://<EXTERNAL-IP>:<port>
# <a href="/dashboard/">Found</a>
参考
上次更新 2019-02-25
原始文档 查看本文 Markdown 版本 »