Location of Kubernetes config directory with Docker Desktop on Windows

人走茶凉 提交于 2021-02-16 15:18:05

问题


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?


回答1:


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:

  • Minikube.sigs.k8s.io: Docs: Commands: Start

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:

  • Stackoverflow.com: Answer: Where are the Docker Desktop for Windows kubelet logs located?
  • Stackoverflow.com: Answer: How to change the default nodeport range on Mac (docker-desktop)?

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



来源:https://stackoverflow.com/questions/64758012/location-of-kubernetes-config-directory-with-docker-desktop-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!