Rancher Server 设置
- Rancher 版本:2.7.5
- 安装选项:Helm
- Local 集群的类型和版本:RKE2 1.26.7
用户信息
- 登录用户的角色:项目所有者
问题描述:
如何让Rancher的项目所有者用户如何使用kubectl从外部访问集群?
项目所有者用户可以在Rancher的Kubectl Shell中使用kubectl管理项目命名空间的资源。如果将该用户的KubeConfig保存至集群外部主机的~/.kube/config,执行kubectl get pod查看项目命名空间的pod会出现错误信息:
[gitlab-runner@localhost ~]$ kubectl get pod -n test
E1005 18:12:17.931387 109742 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E1005 18:12:17.945431 109742 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E1005 18:12:17.957814 109742 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E1005 18:12:17.972268 109742 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
E1005 18:12:17.983172 109742 memcache.go:265] couldn't get current server API group list: the server could not find the requested resource
Error from server (NotFound): the server could not find the requested resource