Docker for Windows stuck at “Kubernetes is Starting”

Viewed 2358

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

2 Answers

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 )

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
Related