Is there a way to run react Application on SpringBoot and to in Kubernetes?

11/26/2019

I am running the React Application on Spring Boot which runs as containers in Kubernetes. When the react application interacts with the backend through REST, It should resolve the dns of the REST URI.

I have tried directly giving the service name(i.e. while calling the REST API from react application i have given the https://service-name:port/api/v1/test/), but it is not working.

-- chandu
kubernetes
microservices
reactjs
spring
spring-boot

1 Answer

11/26/2019

In case your backend is on another namespace use the following format:

<service-name>.<namespace-name>.svc:port

For a Kubernetes service demo-ser on demo namespace the URL will be something like:

https://demo-ser.demo.svc:8080/
-- Kamol Hasan
Source: StackOverflow