我尝试使用头盔将Traefik(v1.7)部署到本地minikube集群
<PackageReference Include="Microsoft.Extensions.Hosting" Version="3.0.1" />
values.yml:
helm install --values values.yml stable/traefik
我在/ etc / hosts文件中添加了dashboard.localhost 但是我无法访问仪表板。
dashboard:
enabled: true
domain: dashboard.localhost
kubernetes:
namespaces:
- default
- kube-system
没有回应...
curl http://dashboard.localhost:31745/
404 page not found
curl http://dashboard.localhost/
任何idaes?
更新:
A根据Traefik文档创建并应用了两个服务。 我的变体:
minikube service list
|----------------------|-----------------------------------|--------------------------------|-----|
| NAMESPACE | NAME | TARGET PORT | URL |
|----------------------|-----------------------------------|--------------------------------|-----|
| default | coiled-cardinal-traefik | http://192.168.99.111:31731 |
| | | http://192.168.99.111:31745 |
| default | coiled-cardinal-traefik-dashboard | No node port |
| default | kubernetes | No node port |
| default | traefik-web-ui | No node port |
| kube-system | kube-dns | No node port |
| kube-system | tiller-deploy | No node port |
| kube-system | traefik-web-ui | No node port |
| kubernetes-dashboard | dashboard-metrics-scraper | No node port |
| kubernetes-dashboard | kubernetes-dashboard | No node port |
|----------------------|-----------------------------------|--------------------------------|-----|
kubectl get svc coiled-cardinal-traefik --namespace default -w
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
coiled-cardinal-traefik LoadBalancer 10.111.40.100 <pending> 80:31731/TCP,443:31745/TCP 36m
Traefic 1.7文档版本:
apiVersion: v1
kind: Service
metadata:
name: traefik-web-ui
namespace: default
spec:
selector:
app: traefik
ports:
- name: web
port: 80
targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: traefik-web-ui
namespace: default
spec:
rules:
- host: dashboard.localhost
http:
paths:
- path: /
backend:
serviceName: traefik-web-ui
servicePort: web
我的/ etc / hosts
apiVersion: v1
kind: Service
metadata:
name: traefik-web-ui
namespace: kube-system
spec:
selector:
k8s-app: traefik-ingress-lb
ports:
- port: 80
targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: traefik-web-ui
namespace: kube-system
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: traefik-ui.minikube
http:
paths:
- backend:
serviceName: traefik-web-ui
servicePort: 80
打开http://traefik-ui.minikube 最终结果是ERR_CONNECTION_TIMED_OUT ...
答案 0 :(得分:0)
要访问仪表板,您必须创建两个服务,如traefik docs中所述:
apiVersion: v1
kind: Service
metadata:
name: traefik-web-ui
namespace: kube-system
spec:
selector:
k8s-app: traefik-ingress-lb
ports:
- port: 80
targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: traefik-web-ui
namespace: kube-system
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: traefik-ui.minikube
http:
paths:
- backend:
serviceName: traefik-web-ui
servicePort: 80
,然后在etc/hosts:
echo "$(minikube ip) traefik-ui.minikube" | sudo tee -a /etc/hosts