'Docker For Windows CE: Kubernetes: Unable to connect to the server eof

I simply cannot find a solution for this " Unable to connect to the server eof", hopefully we solve this and it helps somebody in future, when searching to fix this issue. I tried to include all information in the screenshot. Let me know if more information is required.

I have tried to add the information requested, let me know if theres anything else you need or want me to try.

CMD Information

More Information



Solution 1:[1]

Please try to get into logs of kube-dns docker container directly as below:

  1. Enable 'Show system containers' option in Docker Desktop settings: enter image description here
  2. Check if kube-dns container was ever run:

docker ps -a --filter name=k8s_kubedns_kube-dns --format "table {{.ID}}\t{{.Image}}"

You should see similar command output to this:

CONTAINER ID IMAGE
9009731e183d 80cc5ea4b547

  1. Get kube-dns container logs with:

docker logs {your_container_id} --tail 100

Solution 2:[2]

I had this error (with Docker Desktop on Windows 11, using wsl2), and the solution for me was to use the Settings page (in DD), then choose "Kubernetes" on the left, then chose "reset kubernetes cluster". That warned that all stacks and k8s resources would be deleted, but as nothing else had worked for me (and I wasn't worry about losing much), I tried it, and it did solve the problem.

FWIW, k8s had been working fine for me for some time. It was just that one day I found I was getting this error. I searched and searched and found lots of folks asking about it but not getting answers, let alone this answer (even here). To be clear, I had tried restarting Docker Desktop, restarting the host machine, even downloading and installing an available DD update (I was only a bit behind), and nothing worked. But the reset did.

I realize some may fear losing something, but again it worked and was worth it for me. Hope that may help others.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 charlie arehart