This topic describes how to deploy microservice-oriented applications in Enterprise Distributed Application Service (EDAS). EDAS provides microservice-oriented application demos that use the following frameworks: Spring Cloud, Dubbo, and High-speed Service Framework (HSF). You can deploy application demos to the specified Kubernetes clusters. This topic provides an example on how to deploy a microservice-oriented application in a Kubernetes cluster.
- EDAS is activated. For more information, see Activate EDAS.
- A Container Service for Kubernetes (ACK) cluster is created and added to EDAS. This
operation is required because you cannot create a Kubernetes cluster in EDAS. For
more information, see Use the EDAS console to manage Kubernetes clusters.
Note To experience the deployment practice, we recommend that you add your Kubernetes cluster to the default microservice namespace of the region that you use. If you want to isolate resources and services in EDAS, you can add the Kubernetes cluster that you created to a specified microservice namespace based on your requirements.
- An application image is created. For more information, see Create an application image.
- The RAM user that you use is authorized by the relevant Alibaba Cloud account to use the images in a repository of Container Registry Enterprise Edition to deploy applications. For more information, see Configure policies for RAM users to access Container Registry.
- Kubernetes cluster: In this practice, you must use a Kubernetes cluster that is deployed in a specified region and microservice namespace.
- Application demo: EDAS provides the demo image of a sample microservice-oriented application
in the EDAS console. The demo contains a server-side application (service provider)
and a client-side application (service consumer). This demo shows how to perform simple
service calls. EDAS also provides WAR and JAR packages of microservice-oriented application
demos that use the Spring Cloud, Dubbo, and HSF frameworks. For more information about
how to deploy applications by using JAR or WAR packages, see Use a JAR or WAR package to deploy an application in an ACK cluster and Use a JAR package or a WAR package to deploy an application in a serverless Kubernetes cluster.
In this example, an application demo that uses the demo image is deployed. For more information about the microservice-oriented application demos, see alibabacloud-microservice-demo.
- For information about how to implement features of an application with microservices, see Overview.
Deploy the demo image of a sample microservice-oriented application
The demo image of a microservice-oriented application contains a server-side application (service provider) and a client-side application (service consumer). This topic describes how to deploy the service provider. After you deploy the service provider, follow the instruction in this section to deploy the service consumer.
- Log on to the EDAS console.
- In the left-side navigation pane, click Applications.
- In the top navigation bar of the Applications page, select the region in which you want to deploy the application. On the page that appears, select the microservice namespace that you want to manage and click Create Application.
- In the Application Information step of the Create Application wizard, specify the basic information about the application and click Next.
- In the Cluster Type section, click Kubernetes Clusters.
- In the Application Runtime Environment section, set the Hosted Applications parameter to Java and the Select Application parameter to Custom.
- Select Use the registry configured by the program (i.e. do not use the registry provided by EDAs for Nacos) to the right of Service Registration and Discovery based on your business requirements. For more information about service registries, see Select an O&M method for your service registry.
- In the Configurations step, configure the application environment, select the required demo image, and
then click Next. Note The RAM user that you use must be authorized by the relevant Alibaba Cloud account to use the images in a repository of Container Registry Enterprise Edition to deploy applications. For more information, see Configure policies for RAM users to access Container Registry.
- Select Default from the Microservice Namespaces drop-down list.
This topic provides an example on how to deploy a microservice-oriented application demo in a Kubernetes cluster. We recommend that you use the default microservice namespace and do not create a microservice namespace when you deploy a microservice-oriented application demo in a Kubernetes cluster. If you want to isolate resources and services when you use EDAS, you can create a microservice namespace. For more information , see Microservice namespaces.
- Select the Kubernetes cluster in which you want to deploy the application from the
Cluster drop-down list. Note If the selected Kubernetes cluster is not imported to EDAS, select This cluster is used for the first time in EDAS. If you select this check box, the cluster is imported to EDAS when an application is created. This consumes an amount of time. Then, check whether Alibaba Cloud Service Mesh is activated.
- Select default from the K8s Namespace drop-down list.
If you want to create a custom Kubernetes namespace, click Create Kubernetes Namespace. In the dialog box that appears, enter a name for the Kubernetes namespace in the K8s Namespace field. The name can contain digits, lowercase letters, and hyphens (-), and can be 1 to 63 characters in length. It must start and end with a letter or a digit.
- Enter a name for the application in the Application Name field.
- Optional:Enter a description for the application in the Application Description field.
- Select Demo Image for the Image Type parameter.
- In the Select Image section, set the Image Repository and Project parameters and select the uploaded demo.
- In the Select Image section, select edas-demo-image from the Image Repository Namespace drop-down list. Then, select 1.0 from the rightmost drop-down list of edas-demo-image/provider. The demo image edas-demo-image/provider in the image repository edas-demo-image and the image version 1.0 are provided by EDAS. You are not allowed to change the settings.
- Set the Total Pods parameter to 1.
- In the Single-pod Resource Quota section, set the CPU Cores parameter to 1 and the Memory (MB) parameter to 2048.
- Select Default from the Microservice Namespaces drop-down list.
- In the Advanced Application Settings step, click Create Application. In the Advanced Application Settings step, you can configure the advanced settings based on your requirements. For more information, see the Advanced settings
- In the Application has been created. step, confirm Application Information, Application Configuration, and Advanced Application Settings. Then, click Create Application.
After EDAS starts to deploy the application, the message Application change in progress... is displayed in the upper part of the Basic Information tab. The deployment takes about 2 minutes.
You can also click View Details next to the message to go to the Change Records page of the application. On this page, you can check the deployment progress and log data.
- Repeat the preceding steps to deploy the client-side application.
Verify the result
The service consumer can be a web service consumer. After the server-side application and the client-side application are deployed, you can access the web page of the client-side application to verify the result.