Reactjs in kubernetes getting error net::ERR_CONNECTION_REFUSED when using axios "GET" in backend express using DNS service endpoint

7/13/2021

I'm trying to deploy my ReactJs in Kubernetes and my backend server is running ExpresssJs (cors enabled).

But I'm getting this error message net::ERR_CONNECTION_REFUSED in my Reactjs chrome console when trying to GET.

GET https://express-api.dev-d.svc.cluster.local/v1/api/ net::ERR_CONNECTION_REFUSED

but when trying to execute the CURL command in my Reactjs pod to my ExpressJs URL there are no issues at all I'm getting the right response.

Not sure if this is a limitation in Kubernetes?

-- ariel.chiong
connection-refused
express
kubernetes
reactjs

1 Answer

7/23/2021

After further research, seems this is not possible from what I've read.

from here: https://stackoverflow.com/questions/53148660/communication-from-pod-to-pod-on-same-node-inside-kubernetes-in-gcp

-- ariel.chiong
Source: StackOverflow