Jaume Garcia Sanchez
Jaume Garcia Sanchez

Reputation: 310

How to manage kubectl from another user

Hi i have a server configured with kubernetes (without using minikube), i can execute kubectl commands without problems, like kubectl get all, kubectl delete pod, kubectl delete apply ...

I would want to know how to allow another user from my server to execute kubectl commands, because if i change to another user and i try to execute kubectl get all -s localhost:8443 i get:

Error from server (BadRequest): the server rejected our request for an unknown reason

I have read the Kubernetes Authorization Documentation, but im not sure if it is what im looking for.

Upvotes: 2

Views: 3412

Answers (1)

Arghya Sadhu
Arghya Sadhu

Reputation: 44559

This is happening because there is no kubeconfig file for the user.You need to have the same kubeconfig file for the other user either in the default location $HOME/.kube/config or in any location pointed by KUBECONFIG environment variable.

You can copy the existing kubeconfig file for the working user to the above location for the non working user.

Upvotes: 6

Related Questions