0

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?

4
  • 3
    You can't reach localhost:3000. If you modify your services so that they are listening on all addresses (0.0.0.0) instead of localhost, you could use kubectl 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). Commented Jan 17, 2023 at 1:41
  • 1
    Pedantically, 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 Commented Jan 17, 2023 at 3:36
  • @mdaniel: So what is the way to work/test pods deployed on a local Kubernetes cluster? Only writing automated tests using Jest for example? Commented Jan 17, 2023 at 4:40
  • Well, what have you already tried and what outcome is it producing for you? Don't put that in the comments, instead edit your question and include those specifics. The most common way is via an Ingress Commented Jan 17, 2023 at 16:59

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.