Kubernetes:禁止使用配置文件:用户" kube"无法在命名空间中列出配置映射"默认"

时间:2018-05-15 19:40:50

标签: kubernetes kubectl kops

我在Medium上按照本教程在AWS上部署Kubernetes集群: https://medium.com/containermind/how-to-create-a-kubernetes-cluster-on-aws-in-few-minutes-89dda10354f4

但是,当我启动Kubernetes仪表板时,我发现以下错误:

configmaps is forbidden: User "kube" cannot list configmaps in the namespace "default"
persistentvolumeclaims is forbidden: User "kube" cannot list persistentvolumeclaims in the namespace "default"
secrets is forbidden: User "kube" cannot list secrets in the namespace "default"
services is forbidden: User "kube" cannot list services in the namespace "default"
ingresses.extensions is forbidden: User "kube" cannot list ingresses.extensions in the namespace "default"

为什么会这样?

enter image description here

2 个答案:

答案 0 :(得分:6)

问题是本教程的第13步是:

  

kops获取秘密kube --type secret -oplaintext

应该是:

  

kops获取秘密admin -oplaintext

答案 1 :(得分:3)

您已登录的User kube,无权列出K8跟踪的对象。您可以提升kube的权限,也可以创建具有正确权限的ServiceAccount来列出这些对象。