Monday, January 20, 2020

Docker Desktop for Windows: Kubernetes stuck at starting

I wanted to set up a local Kubernetes cluster and Docker Desktop includes a standalone Kubernetes server and client, as well as Docker CLI integration. The Kubernetes server runs locally within your Docker instance, is not configurable, and is a single-node cluster.

But after enabling Kubernetes on my Docker Desktop, it was at "Kubernetes is starting" forever and was trying to figure out the issue. 
Kubernetes is starting
Some have suggested doing a complete Docker Desktop cleanup and reinstall, but I didn't want to do that. After spending a couple of hours, found the logs at this directory: C:\ProgramData\DockerDesktop. There were some service.txt files, and I have opened the recently modified one and finally able to found out what the issue is.
[19:32:58.189][ApiProxy][Error] time="2020-01-20T19:32:58+13:00" msg="Cannot list nodes: Get https://kubernetes.docker.internal:6443/api/v1/nodes: EOF"
And from there onwards, it was easy to fix. According to issues/4316, I had to remove the folder named pki inside C:\ProgramData\DockerDesktop and restarted the docker. On the start, it will create the pki folder back again.

And finally, it's all good.
Kubernetes is running
But note, this might not be the reason for all the hangs at starting, but checking the logs will definitely point you in the right direction.

Hope this helps.

Happy Coding.


No comments:

Post a Comment