<p>I want to create a kubernetes user who can access k8s dashboard to only few namespaces(let's assume 3 namespaces) using same token or config file and user should be able to use kubectl to get information from cluster with config file. Is this something achievable?</p>

<p>I tried creating Role and Rolebinding for user but with this, user can access from the command line interface but not from dashboard because token is not generated. Followed this process 
<a href="https://www.openlogic.com/blog/granting-user-access-your-kubernetes-cluster" rel="nofollow noreferrer">https://www.openlogic.com/blog/granting-user-access-your-kubernetes-cluster</a></p>

<p>Other option I tried is to create a user as service account in each namespace and I could able to generate dashboard token, but the problem is user will have separate token for each namespace and separate config file for each namespace. Every time user has to logout from dashboard to switch between namespaces, this works but very inconvenient for developers.</p>

<p>Is there any better option? my requirement is 
1. Create a user who can access k8s cluster from command line and also dashboard to only few namespaces access with single config file and single dashboard token.</p>

Ram
<p>If you define a <code>clusterrole</code> such a way that it gives permission to few namespaces and create a <code>clusterrolebinding</code> to bind that <code>clusterrole</code> to the service account then the same token will effectively have permission to all those namespaces.</p>
