Issue: From outside cluster, exposing service via NodePort, I am unable to reach the application. I should be to get a response from MyApp: From my mac client (http://nodeIP:nodePort/api/users) --> node (nodePort) --> service (endPoints) -- pod --> MyApp (in container)
Setup:
- OS: Mac and DockerDesktop using KIND, created cluster (1-master, 2-workers)
- deployed simple app and able to 'kubectl exec myPod -- curl http://localhost/api/users' <-- this does work
- Then created 'service' with type:NodePort (auto picked by k8)
- Supposedly from my Mac (client), I should be able to reach MyApp but trying to 'curl (http://nodeIP:nodePort/api/users)' just times out.
Request: Not sure what is missing: is it firewall blocking it, is there a port forwarding missing, something else ... from my computer trying to 'curl http://:/api/users' times out.
side note: I know I can use other methods like ingress. For now, I am trying to learn and figure out why NodePort method isn't working.
nodeIP
in your URLs? Have you configured kind's networking layer at all? - David Mazekubectl describe svc
andkubect describe pod -o wide
. Also might be good to see any yaml you have. - Brian Pursleylocalhost
works andNodePort
doesn't could mean the service is listening only on localhost inside the container -- the tie-breaker would be whether you can access that Pod from another Pod within your cluster (and then the same experiment against the Service from within the cluster) - mdaniel