Microservice architecture consists of a collection of loosely coupled, self-contained services that can be deployed independently. Given the limited capacity of the resources for a large number of services, the deployment of the services does not scale well and leads to operational complexity and runtime overhead. This paper proposes a model-driven approach for the automated deployment of microservices to minimize the execution cost and communication costs among the microservices. The identification of the feasible deployment is defined at the architecture design level based on the provided capacity of the resources and the collection of microservices. The corresponding tool support using Eclipse Modeling Environment is described, and a case study on book shopping is used to illustrate the approach.