Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes: configmaps is forbidden: User "kube" cannot list configmaps in the namespace "default"

I followed this tutorial on Medium to deploy a Kubernetes cluster on AWS: https://medium.com/containermind/how-to-create-a-kubernetes-cluster-on-aws-in-few-minutes-89dda10354f4

However, when I launch the Kubernetes dashboard I see the following errors:

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"

Why is this happening?

enter image description here

like image 415
etayluz Avatar asked May 15 '18 19:05

etayluz


2 Answers

The problem is that step 13 of the tutorial reads:

kops get secrets kube --type secret -oplaintext

It should instead be:

kops get secrets admin -oplaintext

like image 124
etayluz Avatar answered Nov 15 '22 20:11

etayluz


The User you've logged in as, kube, doesn't have permission to list the objects that K8s keeps track of. You can either elevate the permissions of kube, or create a ServiceAccount with the right permissions to list those objects.

like image 4
David Muckle Avatar answered Nov 15 '22 20:11

David Muckle