Unable to start kubernetes on docker desktop win 10 pro
- [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
- Start up docker, with kubernetes enabled
- Kubernetes stays orange forever.
- 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.
Faced the same issue today, tried this solution with no luck: https://github.com/docker/for-win/issues/1962#issuecomment-447609018
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?
Try deleting the PKI folder from C:\ProgramData\DockerDesktop
https://github.com/docker/for-win/issues/3769
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.
same here, using edge and deleting that folder now made both services green for me as well. thanks a lot!
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.
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.
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!
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. :-(
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:
as docker/for-win#1962 --> delete both pki & .kube folder fixed my issue
once delete pki &.kube, reset, re-enable kubernetes, how long do you have to wait for the installation to complete?
No need re-install, just reset it should up as fast as fresh.
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
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.
- Enabled kubernetes; 'cluster installation' never completes - waiting for kubernetes to start
- Shutdown docker desktop.
- Deleted PKI folder
- Restarted docker desktop
- reset docker desktop to factory defaults
- re-enabled kubernetes in UI
- 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.
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.
For me this resolved it after updating latest stable version:
- Quit docker desktop
- Delete C:\ProgramData\DockerDesktop
- Start up docker desktop
- Wait a few minutes before k8s light turns green
For me this resolved it after updating latest stable version:
- Quit docker desktop
- Delete C:\ProgramData\DockerDesktop
- Start up docker desktop
- Wait a few minutes before k8s light turns green
Really nice. It worked for me. Thanks.
For me this resolved it after updating latest stable version:
- Quit docker desktop
- Delete C:\ProgramData\DockerDesktop
- Start up docker desktop
- Wait a few minutes before k8s light turns green
It worked for me also. Thanks
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.