cnrancher / kube-explorer

A portable explorer for Kubernetes, without any dependency.
Apache License 2.0
215 stars 26 forks source link

web-shell is invalid #3

Closed tufeiping closed 3 years ago

tufeiping commented 3 years ago

When i use web-shell, the status bar display "connecting", After a while, status is "Disconnected".

server log:

ERRO[0007] Error during subscribe websocket: close sent ERRO[0007] Error during subscribe websocket: close sent ERRO[0013] Error during subscribe websocket: close sent ERRO[0013] Error during subscribe websocket: close sent ERRO[0158] Error during subscribe websocket: close sent ERRO[0158] Error during subscribe websocket: close sent

niusmallnan commented 3 years ago

web-shell需要拉取一个镜像 rancher/shell ,创建一个Pod,在Pod里执行相关命令。

按照以下思路排查:

  1. shell pod是否创建成功?你可以在kube-system下看到这个Pod状态:dashboard-shell-xxx
  2. 查看浏览器的前端请求,是否出现特殊提示?比如浏览器提示该ws请求不合法
tufeiping commented 3 years ago

我在所有机器上都重新pull了rancher/shell:v0.1.6,然后重启kube-explorer,还是报错,LOGS: Killing Pod dashboard-shell-vs76g Stopping container shell 27 secs ago Killing Pod dashboard-shell-vs76g Stopping container proxy 27 secs ago Created Pod dashboard-shell-vs76g Created container proxy 28 secs ago Started Pod dashboard-shell-vs76g Started container proxy 28 secs ago Pulled Pod dashboard-shell-vs76g Container image "rancher/shell:v0.1.6" already present on machine 29 secs ago Created Pod dashboard-shell-vs76g Created container shell 29 secs ago Started Pod dashboard-shell-vs76g Started container shell 29 secs ago Pulled Pod dashboard-shell-vs76g Container image "rancher/shell:v0.1.6" already present on machine

niusmallnan commented 3 years ago

你需要关注dashboard-shell的运行状态,找到其意外退出原因,这些日志信息其实意义不大。

我没有做过太多OS/Kernel兼容测试,我一直在AWS上用Ubuntu server进行测试,一直都运行良好。 运行kube-explorer的机器不重要,可能与你的Kubernetes环境有些不兼容。 可以提供一下你的Kubernetes版本,部署方式,OS及其kernel。

备注: Pod dashboard-shel为了一些安全机制,Pod里面搞了一个特殊的user去运行。我曾经意外在openEuler上测试过,确实不兼容,需要runasroot才可以。比较旧的CentOS没有测试过,个人对其3.10kernel很恐惧,问题太多,对容器很不友好。

tufeiping commented 3 years ago

Kubernetes 的版本是 RKE v1.18.8,我的kubeconfig是从Rancher导出来的。 我们内部集群的系统都采用Ubuntu server(18.04)

niusmallnan commented 3 years ago

如果集群已经被Rancher纳管,大可不必使用这个工具,反而会增加困扰。作为一种探索,我会去测试你说的场景。

我测试过,手动部署的RKE,使用其生成的kubeconfig,这个场景是没问题。