Enterprise Distributed Application Service (EDAS) provides demo applications for Spring Cloud, Dubbo, and High-speed Service Framework (HSF). You can deploy these demos to a Kubernetes (K8s) cluster to quickly learn how to deploy microservice applications. This topic describes how to deploy a microservice application in a Kubernetes environment.
Prerequisites
Create a cluster in Container Service for Kubernetes (ACK) and import it into EDAS. You cannot create Kubernetes clusters directly in EDAS. For more information, see Use the console to manage Kubernetes clusters.
NoteTo quickly get started, you can import your Kubernetes cluster into the default microservices namespace for the region. For production use, you can import the cluster into a custom microservices namespace to isolate resources and services.
If you are a Resource Access Management (RAM) user, your Alibaba Cloud account must grant permissions to your RAM user before you can use an image from a Container Registry Enterprise Edition repository to create an application. For more information, see RAM authorization information.
Background information
Kubernetes environment: A Kubernetes cluster that is in a specific region and microservices namespace.
Application demos: EDAS provides demo images in the console for a pair of microservice applications: a service provider and a service consumer. These applications can perform simple service calls. EDAS also provides JAR and WAR packages for demo microservice applications that use the Spring Cloud, Dubbo, and HSF frameworks. For more information about how to deploy applications from JAR or WAR packages, see Deploy an application from a JAR or WAR package in an ACK cluster and Use a JAR or WAR package to deploy an application in a serverless K8s cluster.
This topic uses a demo image to demonstrate how to deploy a microservice application. For more information about the demo, see alibabacloud-microservice-demo.
For more information about how to implement features for microservice applications, see Application development overview.
Deploy a microservice application demo image
The microservice application demo image contains a server-side application (Provider) and a client-side application (Consumer). This topic describes how to deploy the Provider. After you deploy the Provider, follow the same steps to deploy the Consumer.
-
Log on to the EDAS consoleEDAS console.
-
In the left-side navigation pane, choose .
In the top navigation bar of the Applications page, select a region. On the page that appears, select the target microservices namespace, and then click Create Application.
On the Basic Information tab of the Create Application wizard, set the basic information for the application, and then click Next.
Parameter
Description
Cluster Type
Select Kubernetes Cluster.
Application Runtime Environment
Hosted Applications: Select Java.
Select Application: Select Custom.
On the Application Configuration tab, configure the application environment, select the demo image, and then click Next.
NoteIf you are a RAM user, your Alibaba Cloud account must grant permissions to your RAM user before you can use an image from a Container Registry Enterprise Edition repository to create an application. For more information, see RAM authorization information.

Parameter
Description
Microservices Namespace
Select Default.
NoteThis topic is intended to help you learn how to deploy a microservice application demo in a K8s cluster. For this reason, we recommend that you do not create a new microservices namespace. You can use the default microservices namespace. To isolate resources and services when you use EDAS, you can create a microservices namespace. For more information, see Manage microservices namespaces.
Cluster
Select the target K8s cluster from the drop-down list.
K8s Namespace
Select default from the 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.
Application Name
Enter a name for the application.
Application Description
Enter a description for the application.
Image Type
Select Demo Image.
Image Repository Namespace
Select edas-demo-project from the list. Then, from the list to the far right of edas-demo-project/provider, select version 1.0.
NoteThe edas-demo-project/provider image in the edas-demo-project image repository namespace and its version 1.0 are provided by EDAS as a demo. You cannot change these settings.
Total Pods
Enter 1.
Resource Quota per Pod
Set CPU Reservation (Core) to 1 and Mem Reservation (MB) to 2048.
On the Advanced Settings tab, click Create Application.
The Advanced Settings tab contains advanced settings that you can configure as needed. For more information, see Advanced Configuration.
On the Creation Completed tab, review the settings on the Basic Information, Configurations, and Advanced Settings tabs, and then click Create.
After the application starts deploying, a message appears at the top of the Basic Information page, indicating that the application is being changed. The deployment process takes about two minutes.
You can also click View Details next to the message to open the Change History page of the application. On this page, you can view the deployment progress and related logs.
- Repeat the preceding steps to deploy the client-side application.
Verify the result
The service consumer includes a web service. After you deploy both the server-side and client-side applications, you can access the web page of the client application to verify the service call.
On the Application List page, click the name of the Consumer application to open the Application Overview page.
In the Access Method Configuration section of the Application Overview page, click the icon to the right of Internet-facing SLB.
In the Internet-facing SLB dialog box, set the SLB and listener parameters, and then click Confirm.

From the Select SLB drop-down list, select Create SLB.
If you have an existing SLB instance, you can select it from the list.
Next to TCP | HTTP, click Add New Listener. Set the SLB Port to 80 and the Container Port to 18082.
ImportantConfigure the TCP or HTTP protocol for the application as follows. You need to configure only one of them for access.
Service consumer (Consumer): Set Container Port (Target port) in the TCP or HTTP protocol section to
18082.Service provider (Provider): Set Container Port (Target port) in the TCP or HTTP protocol section to
18081.
If you set the port for the service consumer (Consumer) to
18081, the web page is not accessible.Click Confirm.
It takes about 30 seconds to add the Internet-facing SLB instance. After the instance is added, its IP address and port are displayed next to Internet-facing SLB in the Access Method Configuration section. The address is in the
SLB instance IP:Portformat.Copy the Internet-facing SLB address, paste it into the address bar of your browser, and press Enter.
The web page of the client application appears.

- In the Echo this string text box, enter an arbitrary string, such as
Hello EDAS. Then, click Click here and check whether data is returned from the call in the area below the page.If the Data returned from the call area shows the process in which the client-side application (Consumer) calls the server-side application (Provider) and includes the string you entered, the call is successful and the microservice Demo application is deployed.
2020-08-25T10:00:01.866Z : Consumer received. 2020-08-25T10:00:01.878Z : Provider received. Provider processed after sleep 1 second! Echo String: "Hello EDAS" 2020-08-25T10:00:02.878Z : Provider Return 2020-08-25T10:00:02.882Z : Consumer Return