namespaces is forbidden: User “system:serviceaccount:kube-system:kubernetes-dashboard” cannot list resource “namespaces” in API group “” at the cluster scope

Abdennour Toumi
1 min readMar 23, 2020

--

Scenario

Probably, you are here because you have the same error in the screenshot above.

If so, this means you installed kubernetes dashboard and you are facing this issue.

This means, you are step ahead celebrating the k8s dashboard and show it to your Boss.

But this error lets you angry

Solution

Using Helm

If you installed the dashboard with Helm, you just need to add these values :

rbac:  clusterReadOnlyRole: true  clusterAdminRole: false

If you want to grant wider access, switch the “true” and “false“.

Without Helm

You are a poor man. How come you install apps on top of k8s without Helm ?

  • Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
  • Install k8s dashboard with Helm
helm install k8s-dashboard stable/kubernetes-dashboard \
-n kube-system \
-f values.yaml

Content of values.yaml explained above.

Related:

--

--

Abdennour Toumi

Software engineer, Cloud Architect, 5/5 AWS|GCP|PSM Certified, Owner of kubernetes.tn