V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
salamanderMH
V2EX  ›  问与答

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

  •  
  •   salamanderMH · 2019-05-22 11:35:11 +08:00 · 1818 次点击
    这是一个创建于 1772 天前的主题,其中的信息可能已经有所发展或是发生改变。

    问题

    按 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 一直没响应

    2 条回复    2019-05-22 23:35:00 +08:00
    mritd
        1
    mritd  
       2019-05-22 20:58:51 +08:00 via iPhone
    检查一下 IPTABLES FORWARD 链,docker 重启可能会禁用
    RalphHuang
        2
    RalphHuang  
       2019-05-22 23:35:00 +08:00
    iptables -P FORWARD ACCEPT
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   951 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 21:18 · PVG 05:18 · LAX 14:18 · JFK 17:18
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.