创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。如果未按模板创建问题,管理员有权关闭问题。
确保帖子格式清晰易读,用 markdown code block 语法格式化代码块。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
CentOS7.6 4C 12G

Kubernetes版本信息
v3.2.0

容器运行时
docker version / crictl version / nerdctl version 结果贴在下方

docker : 20.10.11

crictl :

Version: 0.1.0

RuntimeName: docker

RuntimeVersion: 20.10.11

RuntimeApiVersion: 1.41.0

nerdctl version: 未找到

KubeSphere版本信息

kubesphere v3.2.0

k8s 为自己安装v1.21.5 只用一台vmware虚拟机 4C 12G 200G

kubesphere 集群离线模式安装

参考:https://kubesphere.io/zh/docs/installing-on-linux/introduction/air-gapped-installation/

问题是什么
报错日志是什么,最好有截图。

丢失 token,用着用着就报 没有权限访问,之后必须重新登录才行,有时候ks-apiserver 会重启。必须等待30秒左右,等待ks-apiserver重启后 才能访问,否则页面直接报错404。

这个问题在我的环境中经常出现,请重视

页面报错截图:

ks-apiserver 日志

ks-console 日志:

补充:

这个bug实在反复性点击各个菜单后发生的,随机性发生。

有时候怀疑是我内存给的不够,有时候怀疑api-server报错 并没有处理异常导致它不能正常工作,被k8s重启了(重启期间无法正常使用系统)。

    补充:

    W0421 09:47:44.124325 1 client_config.go:615] Neither –kubeconfig nor –master was specified. Using the inClusterConfig. This might not work.

    W0421 09:47:44.127282 1 client_config.go:615] Neither –kubeconfig nor –master was specified. Using the inClusterConfig. This might not work.

    W0421 09:47:44.137475 1 metricsserver.go:238] Metrics API not available.

    I0421 09:47:44.812576 1 interface.go:59] start helm repo informer

    I0421 09:47:44.922905 1 apiserver.go:367] Start cache objects

    I0421 09:47:45.841636 1 apiserver.go:573] Finished caching objects

    I0421 09:47:45.841700 1 apiserver.go:289] Start listening on :9090

    W0421 09:50:04.888722 1 jwt.go:53] token not found in cache

    W0421 09:50:04.896290 1 jwt.go:53] token not found in cache

    W0421 09:50:04.896508 1 jwt.go:53] token not found in cache

    发生异常时经常看到这句话:token not found in cache

    yang305622124 kubectl logs -p 看看 crash 日志,token not found in cache 这个警告是pod重启导致的

    5 天 后

    已完成

    后来我启用的 集群的redis 情况得到的改善,之后再没有报过这个错误。

    我思考可能的原因是 假如没有启用redis,token缓存在系统内存中,有时会丢失。启用redis后token存放在redis中,这样会更安全。

      2 个月 后