0

Our application is a collection of Spring Boot microservices. Today, in our non-Docker world, we use Spring Cloud Netflix (Eureka) for Service Registration and Discovery. This allows us to have the Services communicate with each other via Virtual IPs (VIPs) -- GET http://service-name/resources/{id}.

We're in the process of moving to Docker, running within Rancher 1.6 (using Cattle). We would like to be able to continue using the same HTTP calls; however, it appears we will need to include the port now -- GET http://service-name:1234/resources/{id}.

Is there a way for the Service linking to just know the port it should use?

Thanks.

4 Answers 4

2

http://service-name/resources/... has a port too, it's just not shown because it's port 80 and that is the default for HTTP. So if your containers were listening on 80 instead of 1234, you could write the same for Rancher.

Sign up to request clarification or add additional context in comments.

1 Comment

I was still in the old non-Container way of thinking; I didn't want to change the ports on which the various microservices listened. However, once I took a step back, I realized it didn't matter and this made total sense; it's what I ended up doing. Thanks!
0

You mean to have your services on port 80

You can have a reverse proxy server setup in your environment that will redirect your requests to the different ports of different applications

You can achieve this using any custom reverse proxy solution using nginx or apache http server or anything else

Or you can also look a link here for Traefik, which can be a better solution.

Comments

0

If you never design any microservice in docker, I guess this video will help you as it helped me a lot.

https://www.youtube.com/watch?v=Qw9zlE3t8Ko&feature=youtu.be

Video Summary : They created simple API endpoint using python. and calling that using another container. so two containers talking to each other.

Comments

0

Have a look at jwilders' nginx proxy, it is easy to setup and will allow you to forward a (sub) domain to a specific port (reverse proxy) in the container.

https://github.com/jwilder/nginx-proxy

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.