Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubectl - List only namespaces a user can access

Looking if the below scenario is possible or not -

Lets say user(user1) have access only to namespaces default and marketing.

When we perform kubectl get ns it should display both namespaces.

No other namespaces should be displayed even if they exists because the user1 does not have access to any other namespaces.

We could relate this scenario with the databases where a user can see only the databases they have access to when show databases is performed

like image 417
Avinash Reddy Avatar asked Oct 14 '25 09:10

Avinash Reddy


1 Answers

This isn't possible in Kubernetes. Namespaces are the resources providing the scoping mechanism to limit visibility into other resources. There's no meta-namespace that provides scoping rules for namespaces.

like image 177
Grant David Bachman Avatar answered Oct 17 '25 06:10

Grant David Bachman