Docker for Windows stuck at "Kubernetes is Starting" after updating to version 2.1.1.0 Edge (or Stable)

8/29/2019

I recently updated my Docker for Desktop to latest Edge channel version: 2.1.1.0 on a Windows 10 machine. Unfortunately, after updating, Kubernetes was no longer working as it is always stuck at "Kubernetes is Starting".

I have tried the following so far.

  • Restarting Docker
  • Resetting the Kubernetes Cluster
  • Restoring Factory Default settings
  • Restarting machine
  • Uninstalling and reinstalling Docker

Nothing seems to be working. How can I resolve it?

-- Irshad P I
docker
kubernetes
windows

4 Answers

8/29/2019

After hours of trying out different things, here is what finally helped me:

  1. Restore Docker to Factory Default settings and Quit Docker for Desktop
  2. Delete the folder C:\ProgramData\DockerDesktop\pki (Make a backup of it just in case)
  3. Delete the folder ~\.kube\ (Again make a backup to be safe)
  4. Start Docker again, open Docker settings, make the necessary configuration changes (adding proxy, setting resource limits, etc..), Enable Kubernetes and let it start
  5. Wait a while and both Docker and Kubernetes will be up now.

When you try to connect to Kubernetes using kubectl, you might face another issue like

Unable to connect to the server: x509: certificate signed by unknown authority

You can solve this by

  1. Open ~.kube\config in a text editor
  2. Replace https://kubernetes.docker.internal:6443 to https://localhost:6443
  3. Try connecting again.

If this still doesn't resolve your issue, go through the logs at C:\ProgramData\DockerDesktop\log\ to debug the issue further

-- Irshad P I
Source: StackOverflow

1/9/2020

I recommend you to check your etc/hosts file to have following lines.

127.0.0.1       docker-for-desktop
127.0.0.1       kubernetes.docker.internal

Because docker is failing to resolve your localhost and it get stucks on that state.

And Are you behind some corporate proxy? If so try to switch your proxy or try to bypass it the first time you start the K8. I had the same problem and This solved my issue actually not the upgrading or downgrading.

-- oguz
Source: StackOverflow

1/20/2020

I was facing this today and spent couple of hours trying to fix. First thing is to find out why it keeps hanging in starting. You can find the reason by checking the logs at C:\ProgramData\DockerDesktop. There will be some service.txt files, open the recently modified one.

For me the issue was this,

[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"

Once the issue is known, then we can easily fix it. I have to removed the folder named pki inside C:\ProgramData\DockerDesktop (as mentioned in issues/4316) and restarted the docker.

Now it's all good. This might not be the reason for all the hangs at starting, but checking the logs will definitely help out.

Hope this helps!

-- Jaliya Udagedara
Source: StackOverflow

1/7/2020

What worked for me based on info at https://forums.docker.com/t/waiting-for-kubernetes-to-be-up-and-running/47009:

  1. Reset Docker to factory settings
  2. Quit Docker
  3. Set the KUBECONFIG environment variable to %USERPROFILE%.kube\config
  4. Restart Docker and enable Kubernetes (still took a few minutes to start)
-- Mihail Kostira
Source: StackOverflow