EDAS provides demos for Spring Cloud, Dubbo, and HSF microservice applications to help you understand the deployment flow. This topic describes how to deploy a microservice application demo in a Kubernetes cluster using native methods.
Prerequisites
-
You have activated EDAS. For more information, see Activate EDAS.
-
You have created a Kubernetes cluster. For more information, see Create an ACK managed cluster.
-
You have installed Nginx Ingress for the cluster. For more information, see Create and use an Nginx Ingress to expose a service.
-
You have imported the cluster into EDAS. For more information, see Import a Kubernetes cluster in the EDAS console and Import a Kubernetes cluster using Helm.
NoteEDAS does not support creating Kubernetes clusters. You must first create a cluster or use an existing cluster from another cloud provider. For more information, see Create an application in a Tencent Cloud TKE cluster.
-
You have connected to the cluster using kubectl. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
-
You have installed Helm on your local terminal.
NoteIn this topic, a local terminal refers to the machine that you use to access the network, such as a personal computer or an Elastic Compute Service (ECS) instance. For example, if you log on to an ECS instance from your computer and use kubectl to access an ACK cluster, the ECS instance is the local terminal.
Background information
-
EDAS provides JAR and WAR packages for microservice application demos that use the Spring Cloud, Dubbo, and HSF frameworks. To learn how to deploy JAR or WAR packages, see Deploy an application from a JAR or WAR package in a Container Service for Kubernetes (ACK) cluster and Deploy an application from a JAR or WAR package in a Serverless Kubernetes (ASK) cluster.
-
To learn how to implement features for microservice applications, see Application development overview. For more information about the demos, see alibabacloud-microservice-demo.
Deploy the application
The EDAS microservice application demo includes native deployment configurations for the server-side (provider) and client-side (consumer) applications. It also includes a service and an Ingress to ensure that the applications are accessible.
-
On your local terminal, run the following command to download the Helm Chart package for the demo application.
wget https://edas-hz.oss-cn-hangzhou.aliyuncs.com/helm/edas-apps-demo-chart-1.0.0.tgzNoteThe link to download the Chart package is a public URL. Make sure that you have configured Source Network Address Translation (SNAT) for your cluster. For more information, see Use the SNAT feature of an Internet NAT gateway to access the Internet.
-
On your local terminal, run the following command to create the application using Helm.
helm install edas-apps-demo edas-apps-demo-chart-1.0.0.tgz -
Verify that the application is created.
Check from the command line
Run the following command:
kubectl get cloudappsExpected output:

Check from the console
Log on to the EDAS console. In the navigation pane on the left, click Application Management > Application List to view the created application.
NoteThe Deployment YAML configuration in the Helm Chart package contains the
edas.alibabacloud.com/applabel. After the deployment is created, it is automatically managed by EDAS, and a corresponding EDAS application is generated. For more information, see Create an EDAS application using the native Kubernetes method. -
After you confirm that the application is running, you can run the following command on your local terminal.
kubectl get ingressNote the
ADDRESSvalue from the output for later use.
-
On your local terminal, run the following command to call the
consumer-echoAPI of the consumer application.curl -H "Host: www.edas-consumer.com" http://<IP_ADDRESS>/consumer-echo/HelloReplace
<IP_ADDRESS>with theADDRESSvalue that you obtained in Step 4. This is the IP address of the Nginx Ingress load balancer in the cluster.NoteIf you enabled the public network access option when you created the Kubernetes cluster, you can directly access the application using this IP address. If the IP address is a private IP address, you can access the application only from within the corresponding Virtual Private Cloud (VPC).
-
If output similar to the following is returned, the application was deployed successfully.
1696991186943 Consumer received. 1696991187105 Provider received. Provider processed after sleep 1 second! Echo String: "Hello" 1696991188105 Provider Return 1696991188138 Consumer Return
Delete the application
After you verify the deployment, run the following command to uninstall the Helm Chart and delete the test application.
helm uninstall edas-apps-demo

References
You can also use the console to create a microservice application. For more information, see Quickly deploy Spring Cloud and Dubbo applications in a Kubernetes cluster using the console.