kubectl port-forward $(kubectl get pods --selector "app.kubernetes.io/name=traefik" -n kube-system --output=name) -n kube-system 9000:9000
curl http://127.0.0.1:9000/dashboard/
curl http://172.16.xx.x:9000/dashboard/ 不能访问
dashboard.yaml
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
- match: PathPrefix(`/dashboard`) || PathPrefix(`/api`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
kubectl apply -f /dataF/k8s/tfk/dashboard.yaml
curl http://172.16.0.64/dashboard/
curl http://x.x.x.x/dashboard/
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: dashboard
spec:
entryPoints:
- web
routes:
# && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
- match: Host(`dash.xxx.cn`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
kubectl apply -f dash.yaml
测试
http://dash.xxx.cn/dashboard/