Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Location of Kubernetes config directory with Docker Desktop on Windows

Tags:

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?

like image 558
Chris B. Avatar asked Nov 09 '20 19:11

Chris B.


1 Answers

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

This lets you edit the API server configuration. 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

like image 70
Dawid Kruk Avatar answered Oct 16 '22 12:10

Dawid Kruk