Add user to an existing Kubernetes Cluster

9/3/2019

I just joined a team where they have and existing Kubernetes Cluster running in bare metal servers. I have ssh access to the master server and nodes and I can see the Kubernetes internal pods (etcd, kube-proxy, etc) running when I execute:

docker ps

From here how can I add a user and my laptop certificate to the Cluster?

Thanks in advance.

-- Libert
docker
kubernetes
rbac

2 Answers

9/5/2019

Just to clarify. Here are all official information you were asking about (managing cluster users and context):

In the section Append $HOME/.kube/config to your KUBECONFIG environment variable it's explained more deeply.

Here is also description about using --kubeconfig flag

As described previously, the output might be from a single kubeconfig file, or it might be the result of merging several kubeconfig files.

If the --kubeconfig flag is set, use only the specified file. Do not merge. Only one instance of this flag is allowed.

-- Hanx
Source: StackOverflow

9/3/2019

If the cluster was created using kubeadm then it should have a kubeconfig file in the master at /etc/kubernetes/admin.config. You can use kubeconfig files in kubectl with --kubeconfig=/path/to/my.config If the kubeconfig is not there the administrators probably have a reason for that and you should ask them to add you as an user and create a kubeconfig for you so you can use kubectl in your own machine.

Besides that, there is an alpha feature of kubeadm enabling the configuration of new users:

  # Output a kubeconfig file for an additional user named foo
  kubeadm alpha kubeconfig user --client-name=foo
-- victortv
Source: StackOverflow