I've created a pod for my java application and exposed it as a node-port service.
I'm able to access it using curl master address:nodeport
only inside the cluster and not from the outside(say my browser).
The purpose of node-port service is to allow external access to pods right? then why can't access it.
kubernetes version v1.13,
Running in the digital ocean cloud.
Expected output: masteraddress:nodeport should work externally
Just try and locate the worker node's IP address on which your pod is running.
change master-address:nodeport
to workernode-address:nodeport
, it worked for me :)
Check whether the node port is serving your application on host: netstat -tunpl | grep "your node port"
and also with the Local Address as 0.0.0.0
or your machines' IP
.
Rather then using NodePort change it to load balancer and access it directly over load balancer Ip address. or eles you can make ingress controller which will make one ingress and you can redirect and exposes services
using ingress and service type load balancer both way you can you can acess application outside
If you are sure everything is correct and running,Check if port is blocked by firewall rules and open it for external traffic.
It looks from your output like your pod selector is not correct. Your output should be something like
Nodeport: "selector label" 31605/TCP
You have "unset", so this nodeport is not connected to anything.
I have a nodeport example on my blog.