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?