Cannot list Nodes or namespaces

9/23/2018

When I try to run kubectl get namespaces or kubectl get nodes commands etc. I am getting this error (I am using Azure Kubernetes Service). I would appreciate any help with this issue.

Error from server (Forbidden): namespaces is forbidden: User "XXXXXXXXXXXXXX" cannot list namespaces at the cluster scope
-- krishna m
azure-aks
azure-kubernetes
kubectl
kubernetes

1 Answer

9/23/2018

This is an authorization module error message: as explained in the Kubernetes docs and, for example, shown here you need to have the permissions to carry out a certain action (in this case: list namespaces and nodes).

Since you didn't share more background on how this cluster is set up or who is responsible for it, I can only suggest to either reach out to the cluster admin to give you the rights, or, if you've set up the cluster yourself, have a look at the AD integration, which may be of use here.

-- Michael Hausenblas
Source: StackOverflow