0

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!

BOY
  • 1
  • 1

1 Answers1

0

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

Taimoor Mirza
  • 1,093
  • 7
  • 19
  • thanks for your answer, I did it, but i want that user "prod-user" don't see "dev" and "stage" namespces when if he do "kubectl get ns". – BOY Aug 16 '22 at 06:26
  • I'll need to see your role and rolbindings. Also, which user is logged in when you run kubectl commands? – Taimoor Mirza Aug 16 '22 at 07:35