" Kubernetes is starting ....." forever error on windows 10 [closed]
Asked Answered
S

16

33

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

Staphylorrhaphy answered 26/3, 2019 at 16:27 Comment(0)
C
14

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.

Clem answered 1/6, 2020 at 1:37 Comment(0)
F
10

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

Forge answered 26/11, 2021 at 9:4 Comment(1)
What is this folder? this is such a Random thing. I tried doing clean reset and adding the proxy ENV var. this is the only thing that worked. I did not delete .kube folder, that will probably cause me to lose all my contexts, and I didn't want that.Invoice
R
8

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

Rival answered 25/7, 2019 at 3:14 Comment(2)
Unfortunately it worked only the first time for me. Error came back. pki folder does not exist anymore so i can't delete it anymore...Lewison
i don't have such a folderTizes
J
5

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

Jeaz answered 1/6, 2019 at 11:28 Comment(1)
In my case, it didn't create any Docker containers (even checked the system containers). Removing the C:\ProgramData\DockerDesktop\pki and restarting Docker fixed it.Borden
A
3

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

Arhna answered 11/7, 2020 at 16:16 Comment(1)
I had the same issue, and resolved in the same way, but before reading this answer :) Actually got into this issue because of manual setting of HTTPS_PROXY env I set for some other application use case.Baroda
B
2

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

Berdichev answered 28/7, 2020 at 6:42 Comment(1)
Thanks you, very much. That is indeed all that was needed, for me. The dashboard then showed it instantly available (not hanging) and kubectl worked as expected.Hotze
M
1

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

Michele answered 6/1, 2020 at 16:48 Comment(1)
This github answer also says this: github.com/docker/for-win/issues/3769#issuecomment-486046718 - No need to "delete all the data", nor "reset" all. Removing the pki folder does NOT destroy the data and it solved the issue for me.Miler
T
1

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

Tooley answered 28/3, 2021 at 16:35 Comment(0)
C
0

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

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

Civility answered 27/3, 2019 at 12:6 Comment(3)
I have followed the instructions in the link you provided. Unfortunately, the kube-dns image is not running here is the output :docker ps -a --filter name=k8s_kubedns_kube-dns --format "table {{.ID}}\t{{.Image}}" CONTAINER ID IMAGE.Staphylorrhaphy
Can you please rather check if any Kubernetes related containers have ever run with this cmd: docker ps -a --filter name=k8sCivility
There are 6 kubernetes containers running :kube-scheduler,kube-controller-manager, kube-apiserver,POD_etcd, POD_kube-scheduler and POD_kube-controller-manager.Staphylorrhaphy
N
0

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.

Notable answered 6/3, 2020 at 20:32 Comment(0)
P
0

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

Pronator answered 26/7, 2020 at 12:7 Comment(0)
G
0

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.
Glib answered 18/5, 2021 at 23:44 Comment(0)
M
0

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)

Million answered 15/8, 2021 at 17:35 Comment(0)
D
0

In my case I couldn't ping the Kubernetes, so:

  1. try ping kubernetes.docker.internal in the Command Line
  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:
    127.0.0.1 kubernetes.docker.internal to the end of the file.
  4. Now it should work)
Devest answered 27/12, 2021 at 17:23 Comment(0)
D
0

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.

Disintegrate answered 14/6, 2022 at 23:36 Comment(0)
C
0

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

Clarey answered 7/7, 2022 at 10:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.