RBAC: kubectl config use-context

9/4/2019

I've set up my k8s Cluster with an admin role and user role and I'm able to switch between roles using

kubectl config use-context admin-context

or

kubectl config use-context user-context

But I don't want the user role to be able to perform this command and switch between admin and user role.

So whats is the best solution? add token or username & password possibly?

-- daverocks
kubectl
kubernetes
rbac

1 Answer

9/5/2019

Simply remove the admin context and the accompanied user from your ~/.kube/config file.

-- Sam
Source: StackOverflow