'Can't access minikube service in browser but curl works fine
basically I did all the steps here https://kubernetes.io/docs/tutorials/hello-minikube/
Create a kubectl deployment and service, exposed the service, but unlike in the tutorial i had to use 'minikube tunnel' for my services to have an external-ip. (output without minikube tunnel running is for EXTERNAL-IP). When I try to access the hello-node app in the browser i eventually get the error message 'The requested URL could not be retrieved ... Connection timed out'
I can curl the URL just fine, even without 'minikube tunnel' running, and I get the correct output. Anybody have an idea what I am missing?
The minikube dashboard works fine in my browser, and the services have their corresponding 'External Endpoints' set if minikube tunnel is active.
Ubuntu 18.04 minikube v1.7.2 kubectl 1.17
If you need more information please tell me!
/e: curl command 'curl -L http://10.102.24.206:8080/'
'curl -L http://192.168.99.102:32243/' works fine aswell
Solution 1:[1]
I had the same issue, where the external IP for the load balancer (service) was 127.0.0.1 and it was exposed to port 6000. I was able to access the service with curl http://127.0.0.1:3000/, but failed with Google Chrome and Safari browser.
In my case, browser was blocking the access, because of error given by Chrome: ERR_UNSAFE_PORT (Safari did not give any response). So I did switch the port to 3000 and everything worked fine.
From the comments, I see that you tried to access service via browser using 192.168.99.102:32243 and in other case 192.168.99.102:30550. These are also ports that might be considered unsafe by the browser (but not by curl).
Thus I guess the issue was that you were using an unsafe port. Changing the port for the service to something trusted like 3000, 5000 or 8080 might have helped.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Sven Anton |
