Apologies if this is a really simple question - I am following the hello-minikube the tutorial on the Kubernetes link below (running on Mac OS)
I created a deployment on port 8380 as 8080 is in use,
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-node ClusterIP 10.100.248.81 <none> 8380/TCP 11s
I also exposed the deployment, but when I try to curl or open the app URL I get connection refused.
Failed to connect to localhost port 8380: Connection refused
Also if I specify --type=LoadBalancer
during the expose step - that also fails to connect.
Any help would be much appreciated.
I've recreated all the steps from the tutorial you have mentioned. Your error only occurs when you do not change the port from 8080 to 8380, in one of the steps provided in the documentation. After you change it in all 3 places, it works perfectly fine. What I suggest is checking if you changed the port in the server.js file - as it is used by the Dockerfile in build phase:
var www = http.createServer(handleRequest);
www.listen(8080); #->8380
Then in the Dockerfile in EXPOSE 8080
# -> 8380. And the last place is while running the deployment:
kubectl run hello-node --image=hello-node:v1 --port=8380 --image-pull-policy=Never
I've tested this with --type=LoadBalancer
.