Connection refused accessing to the local service minikube via ssh

9/6/2019

I have a service running in Minikube (Windows), pulling local images from Docker, I am able to build the image, run, and expose the service locally, the Minikube dashboard seems to be ok, all green, but, when I try to consume the service in web browser, I have the error Connection Refused.

This is the output of the deployments:

PS D:\repos\cloudtest> kubectl get deployments -o wide
NAME            READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS      IMAGES       SELECTOR
hello-minik82   1/1     1            1           60m   hello-minik82   minik82:v1   run=hello-minik82

And the services:

PS D:\repos\cloudtest> kubectl get services -o wide
NAME            TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE    SELECTOR
hello-minik82   NodePort    10.101.244.230   <none>        8502:32431/TCP   61m    run=hello-minik82
kubernetes      ClusterIP   10.96.0.1        <none>        443/TCP          133m   <none>

Minikube service list:

PS D:\repos\cloudtest> minikube service list --namespace default
|-----------|---------------|----------------------------|
| NAMESPACE |     NAME      |            URL             |
|-----------|---------------|----------------------------|
| default   | hello-minik82 | http://192.168.15.18:32431 |
| default   | kubernetes    | No node port               |
|-----------|---------------|----------------------------|

Everything seems to be ok, but when I try to navigate to http://192.168.15.18:32431, the result is Connection Refused.

Running the command minikube ssh, and then $ curl 127.0.0.1:32431, I have the same error:

PS C:\WINDOWS\system32> minikube ssh
                         _             _
            _         _ ( )           ( )
  ___ ___  (_)  ___  (_)| |/')  _   _ | |_      __
/' _ ` _ `\| |/' _ `\| || , <  ( ) ( )| '_`\  /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )(  ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)

$ curl 127.0.0.1:32431
curl: (7) Failed to connect to 127.0.0.1 port 32431: Connection refused

It seems that inside the virtual machine the port 32431 is blocked or closed.

How can I open the port, or find de solution for the connection refused?

-- Phi
docker
kubernetes
minikube
windows

0 Answers