Windows 上 Docker 桌面的 Kubernetes 配置目录的位置 [英] Location of Kubernetes config directory with Docker Desktop on Windows

查看:126
本文介绍了Windows 上 Docker 桌面的 Kubernetes 配置目录的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过 Windows 上的 Docker 桌面运行本地 Kubernetes 集群.我正在尝试修改我的 kube-apiserver 配置,我发现的所有信息都说要修改主服务器上的 /etc/kubernetes/manifests/kube-apiserver.yaml.我一直无法找到此文件,并且不确定执行此操作的正确方法是什么.是不是因为集群是通过Docker Desktop的,所以流程不一样?

解决方案

是否有不同的过程,因为集群是通过 Docker Desktop 的?

您可以使用在 Docker 桌面上运行但在hacky"中的 Kubernetes 访问 kubeapi-server.yaml大大地.我已经在下面提供了解释.

对于需要此类重新配置的设置,我鼓励您使用不同的解决方案,例如 minikube.

Minikube 有一项功能,允许您为 Kubernetes 组件传递附加选项.您可以按照以下文档阅读有关 --extra-config ExtraOption 的更多信息:


关于kube-apiserver.yaml与Docker Desktop的重新配置

您需要运行以下命令:

  • $ docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh

以上命令将允许您运行 $ vi/etc/kubernetes/manifests/kube-apiserver.yaml 并编辑 api 服务器的配置.运行 kubeapi-serverPod 将使用新参数重新启动.

您可以查看以下 StackOverflow 答案以获取更多参考:

I am running a local Kubernetes cluster through Docker Desktop on Windows. I'm attempting to modify my kube-apiserver config, and all of the information I've found has said to modify /etc/kubernetes/manifests/kube-apiserver.yaml on the master. I haven't been able to find this file, and am not sure what the proper way is to do this. Is there a different process because the cluster is through Docker Desktop?

解决方案

Is there a different process because the cluster is through Docker Desktop?

You can get access to the kubeapi-server.yaml with a Kubernetes that is running on Docker Desktop but in a "hacky" way. I've included the explanation below.

For setups that require such reconfigurations, I encourage you to use different solution like for example minikube.

Minikube has a feature that allows you to pass the additional options for the Kubernetes components. You can read more about --extra-config ExtraOption by following this documentation:


As for the reconfiguration of kube-apiserver.yaml with Docker Desktop

You need to run following command:

  • $ docker run -it --privileged --pid=host debian nsenter -t 1 -m -u -n -i sh

Above command will allow you to run $ vi /etc/kubernetes/manifests/kube-apiserver.yaml and edit the configuration of the api server. The Pod running kubeapi-server will be restarted with new parameters.

You can check below StackOverflow answers for more reference:

这篇关于Windows 上 Docker 桌面的 Kubernetes 配置目录的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆