I just installed Docker for Windows 18.02 ce edge to try the Kubernetes functionality. I enabled Kubernetes and after applying or some other action, don’t remember exactly now, a progress dialog opened showing the installation of the Kubernetes cluster. It hung for over an hour with the slider looping hinting that it might be still doing stuff but it never seemed to finish. The only option was to “run in background” so I did that. I restarted Docker and still can’t connect to kubernetes. If I type “kubectl” I get a list of commands so the kubectl command exists in my powershell but if I type “kubectl version” I get this error:
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
I made sure the entry for ::1 localhost is in my hosts file and tried again with the same results.
I have read about Windows hijacking common web ports and I can’t use port 80 so I wonder if it’s the same for port 8080. I tried an nginx container using -p 80:80 and couldn’t get local port 80 to talk to nginx. I switched to -p 8080:80 and that worked fine for the nginx container so the port 8080 should be available for kubernetes since I stopped the nginx container.
How can I set the port for the kubernetes connection used by kubectl? Any other ideas on how to resolve this issue?
Thanks, this put me on the right track. This typically happens in domain environments, where %HOME% (or %HOMEDRIVE% and %HOMEPATH% - probably used by Kubernetes/kubectl to locate the config) do not match %USERPROFILE% (used by the Kubernetes installation to initialize the config).
Thanks! That got me one step closer, but now I’ve run into this problem. I would put money on it that it’s some stupid issue with the corporate antiviruses. But we shall see.
I also have this problem and set KUBECONFIG to $HOME/.kube/config and created the file, but in vein.
Which values should the ~/.kube/config contain for Kubernetes installed by Docker-for-Windows 18.06.0-ce-win72 (19098)?
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
I found why the above behavior appeared: The kubectl command should be run in a DOS shell context, not in cygwin/bash shell context. Even not in a new shell.
Have you found a solution for this one. I am have set the KUBECONFIG path correctly but still Kubernetes hanging with the message “Cluster installation in progress”.
My experience ->
problem -> Post installing DockerDesktop, enabled kubernetes but the installation took forever and never completed.
solution -> factory reset DockerDesktop. set KUBECONFIG as mentioned in @travian `s comment. When i connected to internet via a completely different network than my office network, installation completed in 10 minutes.