All Products
Search
Document Center

Enterprise Distributed Application Service:Use a JAR package or WAR package to deploy an application in an ACK Serverless cluster

更新時間:Jan 24, 2024

Enterprise Distributed Application Service (EDAS) integrates with Container Service for Kubernetes (ACK) based on cloud-native Kubernetes. EDAS allows you to manage the full lifecycle of Kubernetes containerized applications. Serverless Kubernetes clusters are applicable to agile business scenarios that require fast scaling. This topic describes how to use a demo JAR package or a demo WAR package provided by EDAS to deploy an application in a ACK Serverless cluster.

Background information

To deploy an application in a ACK Serverless cluster, create a ACK Serverless cluster in the ACK console. Then, import the cluster in the EDAS console, and use a deployment package or an image to deploy the application in the imported cluster.

Procedure of deploying an application in a Kubernetes cluster

Prerequisites

Step 1: Create an ASK cluster

Log on to the ACK console and create an ACK Serverless cluster. For more information, see Create an ASK cluster.

Step 2: Import an ASK cluster to the EDAS console

By default, the ack-ahas-sentinel-pilot, ack-arms-pilot, and ack-arms-prometheus components are installed when you import an ACK cluster to EDAS in the EDAS console. The ack-ahas-sentinel-pilot component is an application protection component for throttling and degradation. The ack-arms-pilot component is an Application Real-Time Monitoring Service (ARMS) component. The ack-arms-prometheus component is a Prometheus monitoring component.

  1. Log on to the EDAS console. In the left-side navigation pane, choose Resource Management > Serverless Kubernetes Clusters.

  2. In the top navigation bar, select the region and the microservice namespace in which your ASK cluster resides. Then, click Synchronize Serverless Kubernetes Cluster.

  3. Find the ACK Serverless cluster that is synchronized to EDAS and click Import in the Actions column.

  4. In the Warning message, click OK.

  5. In the Precheck for Import dialog box, click Continue.

  6. In the Import Kubernetes Cluster dialog box, select the microservice namespace to which you want to import the ACK Serverless cluster from the Microservice Namespace drop-down list, turn on or off Service Mesh based on your business requirements, and then click Import.

    If the value in the Cluster Status column is Running and the value in the Import Status column is Imported for the ACK Serverless cluster, the cluster is imported to EDAS.

Step 3: Deploy an application in the ACK Serverless cluster

Note

The procedure of deploying an application by using a WAR package is the same as that by using a JAR package. The example in this topic shows you how to use a JAR package to deploy an application.

  1. Log on to the EDAS console. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a microservice namespace. In the upper-left corner of the Applications page, click Create Application.

  2. In the Basic Information step, configure the parameters in the Cluster Type and Application Runtime Environment sections and click Next.

    Parameter

    Description

    Cluster Type

    The type of the cluster in which you want to deploy the application. Select Kubernetes Clusters.

    Application Source Type

    The source of the application. Select Default.

    Application Runtime Environment

    Hosted Applications

    The programming language based on which the application is developed. This topic provides an example on how to deploy a Java application. In this example, select Java. For more information about how to deploy a PHP application or a multilingual application, see Build PHP applications from source code and deploy them in ACK clusters .

    Select Application

    The runtime environment of the application. This topic provides an example on how to use a JAR or WAR package to deploy a Java application. In this example, select Java, Tomcat, or EDAS-Container (HSF) based on the type of your application and deployment package. For more information about how to deploy an application by using an image, see Use an image to deploy a Java microservices application in a Kubernetes cluster.

    • Java: If you want to use a universal JAR package to deploy the application as a Dubbo or a Spring Boot application, select this option. You can specify the Java Environment parameter after you select this option.

    • Tomcat: If you want to use a universal WAR package to deploy the application as a Dubbo or a Spring application, select this option. You can configure the Java Environment and Container Version parameters after you select this option.

    • EDAS-Container (HSF): If you want to use a WAR or FatJar package to deploy the application as a High-Speed Service Framework (HSF) application, select this option. You can configure the Java Environment, Pandora Version, and Ali-Tomcat Version parameters after you select this option.

    Note

    OpenJDK 17 is compatible with Dubbo 2.7.14 and later or Dubbo 3.0.6 and later. For more information about the compatibility test data of OpenJDK 17, see Compatibility test data of OpenJDK 17.

    Table 1. Compatibility test data of OpenJDK 17

    Dubbo version

    Spring Boot version

    Nacos client version

    API call

    ARMS monitoring

    Service list

    2.7.14

    2.7.9

    1.4.4

    Supported

    Supported

    Supported

    2.7.14

    2.7.9

    2.1.2

    Supported

    Supported

    Supported

    2.7.14

    2.7.9

    2.2.0

    Supported

    Supported

    Supported

    2.7.22

    2.7.9

    1.4.4

    Supported

    Supported

    Supported

    2.7.22

    2.7.9

    2.1.2

    Supported

    Supported

    Supported

    2.7.22

    2.7.9

    2.2.0

    Supported

    Supported

    Supported

    3.0.6

    2.7.9

    1.4.4

    Supported

    Supported

    Supported

    3.0.6

    2.7.9

    2.1.2

    Supported

    Supported

    Supported

    3.0.6

    2.7.9

    2.2.0

    Supported

    Supported

    Supported

    3.1.7

    2.7.9

    1.4.4

    Supported

    Supported

    Supported

    3.1.7

    2.7.9

    2.1.2

    Supported

    Supported

    Supported

    3.1.7

    2.7.9

    2.2.0

    Supported

    Supported

    Supported

  3. In the Configurations step, configure the environment information, basic information, deployment method, and resource parameters for the application and click Next.

    Parameter

    Description

    Microservice Namespace

    The microservice namespace in which you want to deploy the application. Select the microservice namespace that you created. If you do not have or select a microservice namespace, this parameter is set to Default.

    If you have not created a microservice namespace or you want to create another microservice namespace, click Create Microservice Namespace to create a microservice namespace. For more information, see the "Create a namespace" section of the Manage microservice namespaces topic.

    Cluster

    The cluster in which you want to deploy the application. Select the imported ACK cluster from the Cluster drop-down list.

    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 a certain amount of time. Then, check whether Alibaba Cloud Service Mesh is activated.

    Note

    You can select a cluster that does not belong to the same microservice namespace as the application.

    K8s Namespace

    The Kubernetes namespace of the application. Internal system objects are allocated to different Kubernetes namespaces to form logically isolated projects, teams, or user groups. This way, different groups can be separately managed and share the resources of the entire cluster. Valid values:

    • default: the default Kubernetes namespace. If you do not specify a Kubernetes namespace for an object, the default Kubernetes namespace is used.

    • kube-system: the Kubernetes namespace for the objects that are created by the system.

    • kube-public: the Kubernetes namespace that is automatically created by the system. This Kubernetes namespace can be read by all users, including unauthenticated users.

    In this example, select default.

    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

    The name of the application. The name must start with a letter and can contain digits, letters, and hyphens (-). The name can be up to 36 characters in length.

    Application Description

    The description of the application. The description can be up to 128 characters in length.

    Source of Deployment Package

    Custom Program

    If you select this option, you must specify the File Uploading Method parameter. Valid values of the File Uploading Method parameter:

    • Upload JAR Package: Select and upload the JAR package that you downloaded.

    • JAR Package Address: Enter the address of your demo package.

    Official Demo

    EDAS provides the following demo types: Spring Cloud Server Application, Spring Cloud Client Application, Dubbo Server Application, and Dubbo Client Application. Select a demo type based on your business requirements.

    Container Registry Repository Type

    Note
    • The Container Registry Repository Type parameter is available only if you deploy Java, Tomcat, or EDAS-Container (HSF) applications in ACK clusters. This parameter is unavailable if you deploy applications in ASK clusters.

    • You must install the aliyun-acr-credential-helper component. For more information, see Use the aliyun-acr-credential-helper component to pull images without secrets.

    • If you want to use an image repository of Container Registry Enterprise Edition, configure access over VPCs. For more information, see Configure access over VPCs.

    • The image build task for the application runs in your cluster and consumes your resources. The default resource limit for a single image build task is 1 GB per core. For more information about how to adjust resource limits for image build tasks, see How do I adjust resource limits for image building?

    If you use a repository of Container Registry Personal Edition or Container Registry Enterprise Edition to store the created image, the image build task runs in your cluster. Build tasks are subject to the following scheduling affinity and toleration rules:

    • EDAS does not schedule build tasks to nodes that have the edas.image.build=disable label.

    • EDAS preferably schedules build tasks to nodes that have the edas.image.build=enable label. However, EDAS may also schedule build tasks to nodes that do not have the edas.image.build label.

    • Build tasks can tolerate nodes that have the key=edas.image.build, effect=NoSchedule taint.

    Note
    • If you do not want to schedule build tasks to specific nodes, add the edas.image.build=disable label to the nodes.

    • If you want to use a node as a dedicated node of a build task, you can add the edas.image.build=enable label and the key=edas.image.build, effect=NoSchedule taint to the node. This prevents pods that do not tolerate the taint from being scheduled to the node.

    Region of Container Registry

    Select the region in which your Container Registry image resides. This parameter is required only if you set the Container Registry Repository Type parameter to Container Registry Enterprise Edition.

    Container Registry

    Select your container image. This parameter is required only if you set the Container Registry Repository Type parameter to Container Registry Enterprise Edition.

    Image Repository Namespace

    Select the microservice namespace in which your image repository resides from the drop-down list. You can also click + Create Namespace to create a microservice namespace.

    Version

    The version number of your application. Specify a custom version number or click Use Timestamp as Version Number to generate a version number.

    Time Zone

    The time zone of the application.

    OpenJDK Base Image

    Note

    The OpenJDK Base Image parameter is available only if you select Custom OpenJDK from the Java Environment drop-down list in the Basic Information step.

    Configure Image

    • If you set the Alibaba Cloud Container Registry parameter to Current Account, perform the following operations:

      Configure the Region, Container Registry, Image Repository Namespace, and Image Repository Name parameters and select an image version.

    • If you set the Alibaba Cloud Container Registry parameter to Other Alibaba Cloud Accounts, perform the following operation: If your image is stored in a public repository, specify the Full Image Address parameter.

      Important

      Only JDK 7 and JDK 8 are supported. If you use a different JDK version, exceptions may be reported when you use the application monitoring feature. The EDAS server pulls the base image to build an application image. Make sure that the pull permissions on the base image are public.

    Total Pods

    The number of pods on which you want to deploy the application. The maximum number of pods is subject to the cluster performance.

    Single-pod Resource Quota

    The CPU, memory, and ephemeral storage that you want to reserve for a pod. If you want to specify a limit, enter a numeric value. The default value 0 specifies that no limit is imposed. The maximum quotas of CPU, memory, and ephemeral storage are subject to the cluster performance.

  4. (Optional) In the Advanced Settings step, configure the advanced settings.

  5. After you configure the advanced settings, click Create Application. In the Creation Completed step, click Create Application.

  6. In the Confirm Application Change Precheck dialog box, click Start Precheck.

    1. After the data in the dialog box is refreshed, confirm the precheck items and results and click Continue.

    2. (Optional) If you modify the preceding precheck items, click Check Again.

    The application requires several minutes to be deployed. During the process, you can view the change records to track the deployment progress of the application on the Change List page. After you deploy the application, go to the Application Overview page to view the running status of pods. If the pods are in the running state, the application is deployed. You can click the running status of pods to view the Deployments, pods, and advanced configurations of the application instances.

What to do next

After the application is deployed, you can add an Internet-facing Server Load Balancer (SLB) instance to allow access to the application over the Internet. You can also add an internal-facing SLB instance so that all the nodes in the same VPC can access the application over an internal network. For more information, see Add an SLB instance to an application in a Kubernetes cluster.

DingTalk group for ACK and Serverless Kubernetes clusters in EDAS

If you have questions or suggestions when you use Container Service for Kubernetes (ACK) and Serverless Kubernetes clusters in EDAS, submit a ticket. To give feedback, you can also join the DingTalk group by searching for the DingTalk group ID 23197114.