k8s 安装了 Dashboard 插件,用 NodePort 访问发现一直没响应?

2019-05-22 11:35:11 +08:00
 salamanderMH

问题

按 github 上操作来的

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml

Service 的 type 我改成了 NodePort,端口用了30001,pod 也跑起来了

root@k8s-spider-master1:~# kubectl -n kube-system get po
NAME                                         READY   STATUS    RESTARTS   AGE
calico-node-fvcm5                            2/2     Running   0          12d
calico-node-m4msr                            2/2     Running   0          22d
calico-node-xmfhk                            2/2     Running   0          12d
coredns-8686dcc4fd-lg9wf                     1/1     Running   0          22d
coredns-8686dcc4fd-sc2v4                     1/1     Running   0          22d
etcd-k8s-spider-master1                      1/1     Running   0          22d
kube-apiserver-k8s-spider-master1            1/1     Running   0          22d
kube-controller-manager-k8s-spider-master1   1/1     Running   0          22d
kube-proxy-9l89z                             1/1     Running   0          12d
kube-proxy-bcrs6                             1/1     Running   0          12d
kube-proxy-sgq8z                             1/1     Running   0          22d
kube-scheduler-k8s-spider-master1            1/1     Running   0          22d
kubernetes-dashboard-69fdd5c8dd-vhcgz        1/1     Running   0          24m
tiller-deploy-c7978c846-jtc8s                1/1     Running   0          7d1h

但是访问curl https://172.16.140.22:30001或者curl http://172.16.140.22:30001 一直没响应

1827 次点击
所在节点    问与答
2 条回复
mritd
2019-05-22 20:58:51 +08:00
检查一下 IPTABLES FORWARD 链,docker 重启可能会禁用
RalphHuang
2019-05-22 23:35:00 +08:00
iptables -P FORWARD ACCEPT

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/566509

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX