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.

Prerequisites

  • 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.

Background information

  • 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.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications.
  3. 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.
  4. In the Application Information step of the Create Application wizard, specify the basic information about the application and click Next.
    Basic application information - Kubernetes
    1. In the Cluster Type section, click Kubernetes Clusters.
    2. In the Application Runtime Environment section, set the Hosted Applications parameter to Java and the Select Application parameter to Custom.
    3. 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.
  5. 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.
    Configurations - Kubernetes
    1. 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.

    2. 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.
    3. 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.

    4. Enter a name for the application in the Application Name field.
    5. Optional:Enter a description for the application in the Application Description field.
    6. Select Demo Image for the Image Type parameter.
    7. In the Select Image section, set the Image Repository and Project parameters and select the uploaded demo.
    8. 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.
    9. Set the Total Pods parameter to 1.
    10. In the Single-pod Resource Quota section, set the CPU Cores parameter to 1 and the Memory (MB) parameter to 2048.
  6. 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
  7. 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.

  8. 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.