【发布时间】:2021-07-28 17:39:50
【问题描述】:
*交叉发布到k3d github discussions、Rancher forums 中的线程和traefik's community discussion board
Tutorials from 2020 指编辑 traefik configmap。去哪儿了?
traefik installation instructions 指的是几种暴露仪表板的方法:
-
这有效,但不是持久的:使用 1-time 命令
kubectl -n kube-system port-forward $(kubectl -n kube-system get pods --selector "app.kubernetes.io/name=traefik" --output=name) 9000:9000 -
我无法让它工作:创建一个“IngressRoute”yaml 文件并将其应用到集群。这可能是由于 Klipper LB 和/或我的无知。
traefik 部署没有使用配置映射
对于 2-server、2-agent 集群...kubectl -n kube-system describe deploy traefik 不显示任何 configmap:
Volumes:
data:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
tmp:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
Priority Class Name: system-cluster-critical
没有“traefik”配置图
而且,kubectl get -n kube-system cm 显示:
NAME DATA AGE
chart-content-traefik 0 28m
chart-content-traefik-crd 0 28m
chart-values-traefik 1 28m
chart-values-traefik-crd 0 28m
cluster-dns 2 28m
coredns 2 28m
extension-apiserver-authentication 6 28m
k3s 0 28m
k3s-etcd-snapshots 0 28m
kube-root-ca.crt 1 27m
local-path-config 4 28m
traefik pod 没有使用配置映射
描述 pod 也不会出现任何问题。 kubectl -n kube-system describe pod traefik-.... 也没有配置映射。
Traefik 端口正在使用,但没有响应
但是,我确实看到了使用端口的 traefik pod 的参数:
--entryPoints.traefik.address=:9000/tcp
--entryPoints.web.address=:8000/tcp
--entryPoints.websecure.address=:8443/tcp
但是,这些端口并未暴露。所以,我尝试使用kubectl port-forward pods/traefik-97b44b794-r9srz 9000:9000 8000:8000 8443:8443 -n kube-system --address 0.0.0.0 进行端口转发,但是当我使用curl -v localhost:9000(或8000 或8443)和curl -v localhost:9000/dashboard 时,我得到“404 Not Found”。
将终端连接到 traefik 后,我发现本地端口已打开,但似乎没有任何响应:
/ $ netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 :::8443 :::* LISTEN
tcp 0 0 :::8000 :::* LISTEN
tcp 0 0 :::9000 :::* LISTEN
/ $ wget localhost:9000
Connecting to localhost:9000 ([::1]:9000)
wget: server returned error: HTTP/1.1 404 Not Found
/ $ wget localhost:8000
Connecting to localhost:8000 ([::1]:8000)
wget: server returned error: HTTP/1.1 404 Not Found
/ $ wget localhost:8443
Connecting to localhost:8443 ([::1]:8443)
wget: server returned error: HTTP/1.1 404 Not Found
版本
k3d version v4.4.7
k3s version v1.21.2-k3s1 (default)
【问题讨论】:
-
我认为你需要在 pod 上做
kubectl describe -
谢谢@P....我已经用那里的发现更新了这个问题。我看到了潜在的端口。也许我只需要弄清楚如何暴露它们......
-
您好,我遇到了同样的问题,我认为它不起作用,但事实证明我需要在 URL 中附加
/dashboard/。尝试检查http://localhost:9000/dashboard/#/http/routers是否反映了来自dashboard.yml的新应用入口路由。如果是,那么你只需要访问http://<domain>/dashboard/
标签: kubernetes traefik configmap k3s k3d