在kubesphere master节点上执行kubectl get po -n xx报出Unable to connect to the server: Forbidden的错误信息,但是集群整体运行是没有问题的,而且在worker节点上是可以执行kubectl get po命令的,最终发现是前段时间在kubesphere master节点设置了http代理的问题(笔者的是内网机器,需要通过http代理服务器访问外网),所以在shell命令行输入下面的命令取消http_proxy、https_proxy即可:
unset http_proxy
unset https_proxy
kubectl get po -n xxx
参考文章: