for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Unable to start kubernetes on docker desktop win 10 pro

Open ghost opened this issue 7 years ago • 48 comments

  • [x] I have tried with the latest version of my channel (Stable or Edge)
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: 16FE78C5-F102-4835-8B7B-98DD34358CF7/20190423131547

Expected behavior

Run Kubernetes on windows docker

Actual behavior

Kubernetes doesnt start up.

Information

  • Windows Version: 10.0.17134
  • Docker for Windows Version: 2.0.0.3 (31259)
  • The setup is behind a corporate proxy, but a local Proxy is set up and configured (Px), a static DNS (8.8.8.8) is configured and the local proxy is configured in docker with 'docker.for.win.localhost:3128'

Steps to reproduce the behavior

  1. Start up docker, with kubernetes enabled
  2. Kubernetes stays orange forever.
  3. Additionally the login in the GUI is not working, although I can log in via CLI or in the web.

It looks like the proxy / network is somehow not working correctly, but all configs that I know of are to my knowledge correctly configured. If anyone has any idea, I would be very grateful, I am now out of ideas and solutions how to get Kubernetes up and running locally.

ghost avatar Apr 23 '19 11:04 ghost

Faced the same issue today, tried this solution with no luck: https://github.com/docker/for-win/issues/1962#issuecomment-447609018

SergeySypalo avatar Apr 24 '19 06:04 SergeySypalo

I switched now to the EDGE channel and it looks a bit better, instead of localhost:6445 endlessly throwing the error that no nodes could be listed, the master now seems to start up, but the system pods don't start up.

looking into the respective docker images, it gives the following error: "k8s.io/client-go/informers/factory.go:132: Failed to list *v1.Service: Get https://vm.docker.internal:6443/api/v1/services?limit=500&resourceVersion=0: 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 " is this something I can configure from outside?

ghost avatar Apr 24 '19 12:04 ghost

Try deleting the PKI folder from C:\ProgramData\DockerDesktop

https://github.com/docker/for-win/issues/3769

jpreese avatar Apr 24 '19 22:04 jpreese

Reinstalled Docker (used Edge channel, as switching before from Edge to Stable and Changing DNS configuration from Automatic to 8.8.8.8 didn't help). But as you mentioned in docker/for-win#3769 deleting C:\ProgramData\DockerDesktop made a magic. Installed Docker for Windows (Edge channel), removed that folder and voila, both services are green in Docker options.

SergeySypalo avatar Apr 25 '19 06:04 SergeySypalo

same here, using edge and deleting that folder now made both services green for me as well. thanks a lot!

ghost avatar Apr 25 '19 07:04 ghost

Same here, deleting the pki directory in C:\programdata\DockerDesktop solved it. I was getting this message: 0/3 system pods running, found labels but still waiting for labels k8s-app=kube-dns. No pods were running, and I could query k8s. I stopped Docker, removed the directory, and started Docker. The directory was recreated, and all the system pods are there now.

giggio avatar Apr 30 '19 18:04 giggio

An initial investigation suggests this could be an installer bug when you install a new version over the top of an existing one and the certs don't get updated. Uninstalling deletes the folder so a clean uninstall / reinstall should work fine.

mikeparker avatar May 30 '19 13:05 mikeparker

Had an apparantly same issue today (Win 10 Pro, Docker Desktop - edge release) and fixed it by renaming the pki folder and resetting the Kuberenetes cluster.

Thanks for the docker/for-win#3769 issue, guys!

RenzoVeldkamp avatar Jun 28 '19 14:06 RenzoVeldkamp

Also experienced what seems to be the same issue (Win 10 Pro, Docker Desktop Stable version 2.1.0.1 (37199), haven't tried Edge yet). As others have already mentioned, deleting the pki folder allowed the Kubernetes cluster to start, but only until the next time I rebooted at which point the symptoms reappeared. :-(

RichardJFoster avatar Aug 13 '19 14:08 RichardJFoster

I faced same issue even whit latest Docker Desktop version since I moved Hyper-V VM to another location. Is anyone person known a fix or workaround ?

Please bellow my logs : [00:00:00.411][ApiProxy ][Warning] time="2019-08-13T00:00:00+02:00" msg="Error while setting up kubernetes: cannot update the host kube config: cannot load current kubernetes config: Error loading config file "C:\Users\cvoluter\.kube\config": yaml: control characters are not allowed. Retrying in 1s" [00:00:00.621][ApiProxy ][Info ] time="2019-08-13T00:00:00+02:00" msg="Cluster config received" [00:

cyvocross avatar Aug 13 '19 15:08 cyvocross

as docker/for-win#1962 --> delete both pki & .kube folder fixed my issue

nghianghesi avatar Aug 22 '19 21:08 nghianghesi

once delete pki &.kube, reset, re-enable kubernetes, how long do you have to wait for the installation to complete?

tongula avatar Sep 20 '19 19:09 tongula

No need re-install, just reset it should up as fast as fresh.

nghianghesi avatar Oct 02 '19 11:10 nghianghesi

i found a solution and the reason: the reason is, that Hyper-V reserves alot of ports automatically, the solution is this; https://github.com/docker/desktop-feedback/issues/783#issuecomment-459205576 but instead of

netsh int ipv4 add excludedportrange protocol=tcp startport=50051 numberofports=1

you do

netsh int ipv4 add excludedportrange protocol=tcp startport=6443 numberofports=1

OmegaRogue avatar Oct 16 '19 15:10 OmegaRogue

I had same issue, today by docker updated itself. I thought this would be a good prompt to go and find out what kubernetes was all about.

  1. Enabled kubernetes; 'cluster installation' never completes - waiting for kubernetes to start
  2. Shutdown docker desktop.
  3. Deleted PKI folder
  4. Restarted docker desktop
  5. reset docker desktop to factory defaults
  6. re-enabled kubernetes in UI
  7. cluster installation in progress

But never starts. Looping with the following 3 log entries over and over.

[14:44:41.557][ApiProxy          ][Warning] time="2019-10-21T14:44:41-07:00" msg="Error while setting up kubernetes: cannot expose the external port: listen tcp 127.0.0.1:6443: bind: An attempt was made to access a socket in a way forbidden by its access permissions.. Retrying in 1s"
[14:44:41.671][ApiProxy          ][Info   ] time="2019-10-21T14:44:41-07:00" msg="Cluster config received"
[14:44:41.681][GoBackendProcess  ][Info   ] Adding tcp forward from 127.0.0.1:6443 to 127.0.0.1:6443

my excluded port ranges are as follows:

PS C:\Users\lx_b> netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      1767        1866
      1867        1966
      1967        2066
      2067        2166
      2180        2279
      2280        2379
      2380        2479
      2480        2579
      2580        2679
      2869        2869
      3263        3362
      3552        3651
      5357        5357
      6440        6539
     10243       10243
     12445       12445
     25831       25930
     28380       28380
     28385       28385
     35447       35447
     50000       50059     *

* - Administered port exclusions.

scyto avatar Oct 21 '19 21:10 scyto

i tried a netcfg -d then rebooted and then reserved the port 6443 as suggested above with netsh int ipv4 add excludedportrange protocol=tcp startport=6443 numberofports=1 this time kubernetes installed ok took a while mind you with lots of [15:09:47.985][ApiProxy ][Info ] time="2019-10-21T15:09:47-07:00" msg="1/3 system pods running, found labels k8s-app=kube-dns but still waiting for labels component=kube-controller-manager, component=kube-apiserver..." errors.

scyto avatar Oct 21 '19 22:10 scyto

For me this resolved it after updating latest stable version:

  1. Quit docker desktop
  2. Delete C:\ProgramData\DockerDesktop
  3. Start up docker desktop
  4. Wait a few minutes before k8s light turns green

kleky avatar Dec 18 '19 09:12 kleky

For me this resolved it after updating latest stable version:

  1. Quit docker desktop
  2. Delete C:\ProgramData\DockerDesktop
  3. Start up docker desktop
  4. Wait a few minutes before k8s light turns green

Really nice. It worked for me. Thanks.

vovanluc1 avatar Dec 24 '19 02:12 vovanluc1

For me this resolved it after updating latest stable version:

  1. Quit docker desktop
  2. Delete C:\ProgramData\DockerDesktop
  3. Start up docker desktop
  4. Wait a few minutes before k8s light turns green

It worked for me also. Thanks

maklipsa avatar Jan 05 '20 14:01 maklipsa

This procedure also worked for me, but I had to go back and rename my .kube folder, restart the Kubernetes cluster, patiently wait several minutes or so for the lamp to turn Green again.

Then: kubectl get all responded without timing out.

I haven't used kubernetes in quite a while and suspect the settings in .kube needed to be reset.

MitchDresdner avatar Jan 11 '20 12:01 MitchDresdner