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

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

问题描述

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

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?

推荐答案

由于集群是通过Docker Desktop进行的,是否存在其他过程?

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

您可以使用在Docker桌面上运行但处于"hacky"状态的Kubernetes访问kubeapi-server.yaml.道路.我已经在下面提供了解释.

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.

对于需要这种重新配置的设置,我建议您使用其他解决方案,例如minikube.

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

Minikube具有一项功能,可让您传递Kubernetes组件的其他选项.您可以按照以下文档阅读有关--extra-config ExtraOption的更多信息:

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:

关于使用Docker Desktop重新配置kube-apiserver.yaml

As for the reconfiguration of kube-apiserver.yaml with 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将使用新参数重新启动.

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.

您可以检查以下StackOverflow答案以获得更多参考:

You can check below StackOverflow answers for more reference:

我在没有$ screen命令的情况下就使用了此答案,并且能够在Windows的Docker桌面上重新配置kubeapi-server

I've used this answer without $ screen command and I was able to reconfigure kubeapi-server on Docker Desktop in Windows

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

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