## 1 Introduction  
Microservice architecture is an architectural style that consists of single functionality services adopting high cohesion and low coupling. The microservice architecture style reduces the interdependence of microservices to facilitate independent deployment, scaling, operation, and maintenance. Likewise, many practitioners and researchers adapt their applications to this architectural style to take advantage of the benefits of microservice architectures. Despite the benefits of microservice architectures, the efficient deployment of thousands of services to limited capacity resources is critical regarding resource utilization and deployment costs. Several industrial tools such as Kubernetes and Docker Swarm have been introduced, but, unfortunately, these do not consider the microservices' runtime behaviors, such as resource consumption and intercommunication during deployment. There are some overlay tools based on these management tools to improve deployment architecture. However, these tools generally perform the deployment according to the configuration file that is manually created by the user, which is a relatively slow, cumbersome, and inefficient task. Moreover, it is difficult to determine the minimum and maximum resources needed by microservices, such as CPU and memory requirements at runtime, to configure the deployment cost-effectively. If generated deployment models are not satisfactory, the deployment process is repeated by creating different configuration files. For generating feasible deployment alternatives, it is necessary to efficiently minimize the total amount of memory required by the services at runtime, the communication costs among microservices, and the execution costs of the services on the existing nodes. Based on the assumption that each node can accommodate a maximum polynomial amount of microservices, this problem can be defined as an NP-complete problem that cannot be solved in polynomial time. As such, near-optimal solutions can be produced in polynomial time [1]. Several studies in the literature have focused on model-driven development (MDD), which is used for microservice architecture (MSA). So far, few studies have proposed the usage of MDD for microservice-based architecture, and these studies focused mainly on the deployment problem of microservices. For example, [PERSON] et al. [2] explain how MDD abstraction, model transformation, and modeling perspectives provide solutions to MSA problems. The proposed MDD tools in the literature address various purposes, such as documentation, recovery [3], architectural analysis, verification and resilience [4]. There are also various studies in which CTAP (Capacitated Task Assignment Problem) algorithms are applied to different areas [5,6]; however, there is a gap in the literature regarding the implementation of CTAP at the design phase for microservice deployment. Our previous study [2] focused on the deployment problem and proposed an MDD-based approach to generate feasible microservice deployment models. The models are presented by extracting many parameters such as the inter-service communication costs, the execution costs of the services on the available nodes, the memory capacity of the services and nodes. In this article, we elaborate on the practical tool challenges and discuss the logical infrastructure of these models, model transformation process, Emfatic [7], and Eugenia [8] plugins used in the architecture. This paper is organized as follows. Section 2 introduces the Model-Driven Development (MDD), and Section 3 describes the advantages and challenges of microservices architecture. Section 4 presents the metamodels created for microservice-based architecture. Section 5 describes the case study to validate proposed model-driven architecture. Section 6 evaluates the proposed approach for the case study in terms of total communication and execution costs. Section 7 discusses the alternative frameworks to develop a model-driven architecture for deploying microservices, and finally, Section 8 concludes the paper.