Docker for Windows stuck at “Kubernetes is Starting”

2/25/2021

I'm using Docker Desktop on windows 10 pro with this docker information docker info

My docker is just fine and I can use docker commands completely. But when it comes to enabling kubernetes. I can't enable it. I just go to docker-desktop settings and check the enable Kubernetes button. but it stuck at "Starting ..." situation. This is the picture: Picture I have used so many ways to solve the problem(e.g: turn the firewall off, delete some docker files) but nothing happens. In the log.txt file, in C:\Users\<usr>\AppData\Local\Docker I see the error:

cannot get lease for master node: Get \"https://kubernetes.docker.internal:6443/apis/coordination.k8s.io/v1/namespaces/kube-node-lease/leases/docker-desktop\": dial TCP: lookup Kubernetes.docker.internal: no such host

-- mosaddegh warner
docker
docker-desktop
docker-for-windows
docker-machine
kubernetes

2 Answers

2/25/2021

From the error message it seemed to me, that you are not able to connect to the kubernetes server.

Check the following: 1. is the kubernetes server enabled in docker? Check the docker docs 2. use kubectl to check the state of the kubernetes server, see the docs for usage of the cmdlet here

-- Genlight
Source: StackOverflow

4/6/2021

I had the same issue. I resolve it , changing the HOSTS file in Widnows (located at C:\Windows\System32\drivers\etc) and adding

127.0.0.1 kubernetes.docker.internal

( I also disable for this operation firewall and antivirus and set 8.8.8.8 in DNS , in docker desktop setting )

-- f0rs4k3n
Source: StackOverflow