Reputation: 2421
I am trying to create a Spring Cloud microservice using Spring and Spring Boot. I developed a Spring Cloud Eureka server as a separate spring boot project. And also created Spring Boot project for Zuul server for gateway proxy and routing.
Upvotes: 2
Views: 129
Reputation: 51738
So when I deploying my microservices, Need to deploy all projects by containerization? So is cloud platform treating all of the microservices into separate containers?
You are not forced to dockerize all you microservices. You can dockerize each microservice on its own and keep some non dockerized. However, there is no obvious benefit in doing that. If you are adopting Docker, it is better to Dockerize all your microservices.
The Docker maven plugin configuration is better done in each project separately. I recommend using the maven plugin only to build the images and optionally push them to a registry. Then you can deploy each image separately. I would recommend that you use Docker compose or Docker swarm for production, to deploy the different microservice containers.
Is there any problem in cloud by deploying my all microservices in separate containers,since they may communicate/call each other?
No there shouldn't be any problems. But you should be careful about hostnames that need to be used when container commmunicate. If you are using docker compose, containers can talk to each other directly by refering to the service name as a hostname. For instance, other microservices can register with Eureka by using http://eureka:8761
. So make sure to set the correct application.properties to reach the other services.
Upvotes: 6