K
Q

" Kubernetes is starting ....." forever error on windows 10

March 26, 2019

I had a kubernetes single node cluster on my windows 10 machine. Due some errors I had to reinstall the

Docker Desktop
and since then kubernetes installation has failed while docker installed successfully. All attempts to resolve e.g. deleting the
config
file in
.kube
directory and complete reinstallation have failed. See attached pix for details. Installed docker version is
Docker version 18.09.2, build 6247962
. All search online efforts do not yield a possible solution. I would appreciate pointers to a solution or walk-around.

enter image description here

-- SyCode
docker
error-handling
kubernetes
failed-installation
docker-desktop

16 Answers

June 1, 2020

I stucked in two kinds of error

  1. system pods running, found labels but still waiting for labels...
  2. xxxx: EOF

I finally sovled it by following the advice by the following project, https://github.com/AliyunContainerService/k8s-for-docker-desktop/ Do as it told you, if not work, remove ~/.kube and ~/Library/Group\ Containers/group.com.docker/pki directory, then restart docker desktop and wait like 5 minutes. The Kubernetes status is running eventually.

-- luudis
Source: StackOverflow

November 26, 2021

For those who did not find the pki folder in the

C:/ProgramData/DockerDesktop
, you may find it in this location :

C:\Users\<your_user_name>\AppData\Local\Docker

Delete it and see if it works. Also make sure to delete the .kube folder

-- joe1531
Source: StackOverflow

July 25, 2019

deleting the pki directory in C:\programdata\DockerDesktop solved the issue for me.

-- Abhishek B Patel
Source: StackOverflow

June 1, 2019

I would suggest you to check running Kubernetes components using command:

docker ps -a --filter name=k8s
as recommended by Nepomucen here.

Then, check the logs for each component using command:

docker logs {container id from the previous command}
. You might some idea from the logs.

In my case, it was-

x509: certificate is valid for docker-for-desktop, kubernetes, kubernetes.default, kubernetes.default.svc, kubernetes.default.svc.cluster.local, host.docker.internal,
not vm.docker.internal

So, I tried the solution suggested in this link and it worked for me

-- sa3036
Source: StackOverflow

July 11, 2020

For anyone coming to this question, what worked for me was the following:

  1. Stop Docker
  2. Add
    kubernetes.docker.internal
    to Windows environment variables list under the name
    NO PROXY
    (**)
  3. Reset docker to default settings
  4. Close and reopen it
  5. Enable Kubernetes

*I followed the steps from this issue on github: https://github.com/docker/for-win/issues/6627#issuecomment-637713206. You can find more explanations there, but mainly windows needs to let kubernetes 'bypass' its proxy.

Some clients support the no_proxy environment variable that specifies a set of domains for which the proxy should not be consulted

**To add a windows environment variable, type

environment
on windows search and open 'Edit the system environment variables' or open it directly from Control Panel. Click
environment variables
button and add a new one to the
system variables

-- David Buzatu
Source: StackOverflow

July 28, 2020

Simply doing the "Reset Kubernetes cluster" on the Reset tab resolved the issue for me.

-- BINFAS K
Source: StackOverflow

January 6, 2020

For future reference, one workaround solution to this MAY BE to delete the C:/ProgramData/DockerDesktop/pki folder.

-- Richard
Source: StackOverflow

March 28, 2021

In my case, I had my kubectl context set to AWS EKS.

  1. Once I have reset my current kubectl context to docker
    kubectl config use-context docker-desktop
  2. Restarted the Docker Desktop
  3. Reset Kubernetes cluster using the button, it started - all supergreen

enter image description here

-- Taras Gleb
Source: StackOverflow

March 27, 2019

I would start from analyzing logs of Kubernetes system-containers.

On how to do this please refer to this answer on StackOverflow.

-- Nepomucen
Source: StackOverflow

March 6, 2020

In my case the system containers were not created, and all I was getting in log was EOF returned from the kubernetes, at the point when the system containers were supposed to be created.

After investigation, there were solutions with .kube and config deletion, pki and similar. I also investigated whether the network setup and company policies, dns and similar would have an impact. All was partially posible but none provided solution.

The only solution that worked was to Uninstall and Install the latest stable Docker Desktop. So, my understanding is that since there are a lot of upgrades on this docker setup over time, some config or part of installation made a confusion and unrecovarable kubernetes setup/first start.

-- zhrist
Source: StackOverflow

July 26, 2020

I had the same problem..

I had deleted the .kube folder located in the user's home directory

(C:\Users\mani\.kube)

Fixed the problem for me...

Kubernetes is running finally

-- Manikandan Ram
Source: StackOverflow

May 18, 2021

Ok finally I found the problem in my kube.

Its seems that my host file was not valid ,cant reproduce is but you can fallow the steps:

  1. open command line and try to get a ping to kubernetes.docker.internal, this is k8s ip that docker adds to the host file.

  2. if you cant get ping (127.0.0.1), save copy of host file (c:\windows\system32\drivers\etc\host) and try to edit/remove docker comments "# Added by Docker Desktop" etc.

  3. if you get the ping docker can get the configured ip.

note: in .kube\config you can see the IP under "server: " key.

  1. you can see the server starting to work in the DDfW image tab (you will see images pops and the total size change. if no working try to restart docker to default factory setting reinstall etc.
-- Beni
Source: StackOverflow

August 15, 2021

In my case, I had to completely uninstall and reinstall the Windows Subsystem for Linux.

So:

  1. Uninstall Docker Desktop. (I also deleted/renamed all the config-data folders)
  2. Uninstall WSL. (final step being the unchecking of "Windows Subsystem for Linux" entry in "Turn Windows features on and off")
  3. Restart PC.
  4. Reinstall WSL. (including another restart)
  5. Reinstall Docker Desktop.

I maybe didn't need every step, but the reinstalling of WSL, at least, was needed in my case. (I did the full Docker Desktop reinstall, and that wasn't enough)

-- Venryx
Source: StackOverflow

December 27, 2021

In my case I couldn't ping the Kubernetes, so: <br/>

  1. try
    ping kubernetes.docker.internal
    in the Command Line <br/>
  2. If you cant get a ping, seems like you have the same problem.
  3. To fix it, open the hosts file (
    c:\windows\system32\drivers\etc\hosts
    ) and add a line: <br/>
    127.0.0.1 kubernetes.docker.internal
    to the end of the file.
  4. Now it should work)
-- Volodymyr Osadchuk
Source: StackOverflow

June 14, 2022

In my case the problem was with the

~/.kube/config
that I had manually edited to add more k8s contexts.

Run this command to validate your config file:

kubectl config view

$ kubectl config view
error: error loading config file "~\.kube\config": yaml: line 88: found a tab character that violates indentation

Fix any errors you see and try again.

-- AndreFeijo
Source: StackOverflow

July 7, 2022

I've got a message

Unable to connect to the server: dial tcp: lookup kubernetes.docker.internal: no such host

This means Windows cannot resolve the internal domain which should be set in the hidden

C:\Windows\System32\drivers\etc\hosts

You can try to edit it as an Adminisrator and insert this line:

127.0.0.1 kubernetes.docker.internal

Link: https://forums.docker.com/t/unable-to-install-kubernetes-stuck-on-starting-state/117048

-- Anastasiya Kryven
Source: StackOverflow