简体   繁体   English

将用户添加到现有的 Kubernetes 集群

[英]Add user to an existing Kubernetes Cluster

I just joined a team where they have and existing Kubernetes Cluster running in bare metal servers.我刚刚加入了一个团队,他们拥有在裸机服务器上运行的现有 Kubernetes 集群。 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:我可以通过 ssh 访问主服务器和节点,并且在我执行时可以看到 Kubernetes 内部 pod(etcd、kube-proxy 等)正在运行:

docker ps

From here how can I add a user and my laptop certificate to the Cluster?从这里我如何将用户和我的笔记本电脑证书添加到集群?

Thanks in advance.提前致谢。

If the cluster was created using kubeadm then it should have a kubeconfig file in the master at /etc/kubernetes/admin.config .如果集群是使用 kubeadm 创建的,那么它应该在master中的/etc/kubernetes/admin.config有一个 kubeconfig 文件。 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.您可以使用 kubectl 中的 kubeconfig 文件--kubeconfig=/path/to/my.config如果 kubeconfig 不存在,管理员可能有原因,您应该要求他们将您添加为用户并为您可以在自己的机器上使用 kubectl。

Besides that, there is an alpha feature of kubeadm enabling the configuration of new users:除此之外, kubeadm 还有一个 alpha 功能可以配置新用户:

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

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.将 $HOME/.kube/config 附加到 KUBECONFIG 环境变量部分中,对其进行了更深入的解释。

Here is also description about using --kubeconfig flag这里也是关于使用--kubeconfig标志的描述

As described previously, the output might be from a single kubeconfig file, or it might be the result of merging several kubeconfig files.如前所述,输出可能来自单个 kubeconfig 文件,也可能是合并多个 kubeconfig 文件的结果。

If the --kubeconfig flag is set, use only the specified file.如果设置了 --kubeconfig 标志,则仅使用指定的文件。 Do not merge.不要合并。 Only one instance of this flag is allowed.仅允许此标志的一个实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM