无法列出节点或命名空间

Cannot list Nodes or namespaces

当我尝试 运行 kubectl get namespaceskubectl get nodes 命令等时出现此错误(我正在使用 Azure Kubernetes 服务)。对于此问题,我将不胜感激。

Error from server (Forbidden): namespaces is forbidden: User "XXXXXXXXXXXXXX" cannot list namespaces at the cluster scope

这是授权模块错误消息:如 Kubernetes docs and, for example, shown here 中所述,您需要具有执行特定操作的权限(在本例中:列出名称空间和节点)。

由于您没有分享有关此集群的设置方式或负责人的更多背景信息,我只能建议联系集群管理员以授予您权利,或者,如果您自己搭建了集群,看看AD integration,这里可能会有用。