Unable to connect to the service in mini cube from a local computer

Viewed 18

I developed service which listen 0.0.0.0:8080. When I run app local it works and i can connect by browser. I push it in image to dockerhub. By this image I created pod and service in my mini kube cluster. By command "minicube service --url" i get url like 192.168.49.2:30965, but I can't connect to this url. I tried with curl and with browser.

I tried connecting with curl and with browser. In browser i got

"ERR_CONNECTION_TIME_OUT".

Curl in shell get error too.

When I use command "minicube service --url" i got this message

! Executing "docker container inspect minikube --format={{.State.Status}}" took an unusually long time: 2.3171367s
* Restarting the docker service may improve performance.
http://192.168.49.2:30965
*  Starting tunnel for service <name>.
! Because you are using a Docker driver on windows, the terminal needs to be open to run it.
1 Answers

You would need, as illustrated here to:

  • create a Deployment and apply it
  • then expose the port:
    kubectl expose -f laravel-deployment.yaml --port=8000 --target-port=8000
  • And port-forward it:
    kubectl port-forward <backend-deployment-xxxx-xxxx> 8000:8000

That last step would allow you to access http://localhost:8000, instead of relying on the dynamic minikube IP.

Related