Reputation: 2675
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.
Upvotes: 0
Views: 630
Reputation: 398
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
Upvotes: 0
Reputation: 275
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.
Upvotes: 0
Reputation: 4033
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.
Upvotes: 0
Reputation: 999
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.
Upvotes: 2