I have a Kind
cluster installed on my Ubuntu machine. I have deployed few pods on the cluster and can see they're running using kubectl get pods
command.
As my pods are some NodeJS
services and a react
web application, they're all serving on localhost:3000
. So I want to reach that address on the cluster and test those pods working fine, but that address doesn't work on my computer and I think I should do some port forwarding maybe, however don't know how?
I want to know how can I reach out localhost:3000
of the locally running Kind cluster and send it http
requests?
localhost:3000
. If you modify your services so that they are listening on all addresses (0.0.0.0
) instead oflocalhost
, you could usekubectl port-forward
to access the services (or create a Service and an Ingress resource to allow access from your host, if you have things configured to permit that).kubectl port-forward
will still work even with nodejs listening on localhost, but those pods can't communicate with anything else in the cluster, so yes, a pod listening on localhost is a very, very, very frequently asked question around here