How to hide a namespace for specific user on kubernetes

496 Views Asked by At

I have three namespaces

  • prod
  • dev
  • stage

And I have two users

  • prod-user : have full access for "prod" namespaces but have no access for "dev" and "stage"
  • dev-user : have full access for "dev" and "stage" namespaces but don't have access on "prod"

On "prod-user", if I get namespace "kubectl get ns", I want that it's show only "prod" namespace

On "dev-user", if I get namespace "kubectl get ns", I want that it's show only "dev" and "stage" namespaces,

thanks!

1

There are 1 best solutions below

2
On

Use Role & RoleBinding to restrict users to specific to allow CRUD operations for a particular namespace. link