Enterprise Distributed Application Service (EDAS) fully integrates with Container Service for Kubernetes (ACK) based on cloud-native Kubernetes. EDAS allows you to manage the full lifecycle of Kubernetes containerized applications. An ACK cluster is embedded with the capabilities of Alibaba Cloud in virtual machines, storage, networking, and security, and provides an excellent runtime environment for Kubernetes containerized applications. This topic describes how to use demo JAR or WAR packages to deploy applications in an ACK cluster.
Background information
To deploy applications in a Container Service for Kubernetes (ACK) cluster, you must create a cluster in the ACK console and import the cluster to the Enterprise Distributed Application Service (EDAS) console. Then, you can use deployment packages or images to deploy applications in the cluster.
Prerequisites
EDAS and ACK are activated for your Alibaba Cloud account. For more information, see the following topics:
ACK default roles are granted to your account. For more information, see ACK roles.
Step 1: Create an ACK cluster
Log on to the ACK console and create an ACK cluster. For more information, see Create a managed Kubernetes cluster.
If you want to create an ACK Serverless cluster, set the VPC parameter to Create VPC and set the Service Discovery parameter to PrivateZone. This allows the ACK Serverless cluster to use Alibaba Cloud Service Mesh (ASM) after the cluster is imported to EDAS. If you set the VPC parameter to Select Existing VPC, check whether the cluster contains virtual private cloud (VPC) and vSwitch resources after you create the cluster. For more information, see Create an ACK Serverless cluster.
Step 2: Import an ACK 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.
Log on to the EDAS console. In the left-side navigation pane, choose .
In the top navigation bar, select the region in which your ACK cluster resides, and click Synchronize Container Service Kubernetes Cluster.
Find the ACK cluster that is synchronized to EDAS and click Import in the Actions column.
In the Precheck for Import dialog box, click Continue.
In the Import Kubernetes Cluster dialog box, select the microservice namespace to which you want to import the ACK 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 cluster, the cluster is imported to EDAS.
Step 3: Deploy an application in the ACK cluster
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.
Log on to the EDAS console. In the left-side navigation pane, choose . 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.
In the Basic Information step, configure the parameters in the Cluster Type and Application Runtime Environment sections and click Next.
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.
NoteYou 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
NoteThe 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 theedas.image.build
label.Build tasks can tolerate nodes that have the
key=edas.image.build, effect=NoSchedule
taint.
NoteIf 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 thekey=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
NoteThe 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.
ImportantOnly 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.
(Optional) In the Advanced Settings step, configure the advanced settings.
After you configure the advanced settings, click Create Application. In the Creation Completed step, click Create Application.
In the Confirm Application Change Precheck dialog box, click Start Precheck.
After the data in the dialog box is refreshed, confirm the precheck items and results and click Continue.
(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 you deploy the application, 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 by using this internal-facing SLB instance. For more information, see Bind CLB instances or Reuse a CLB instance.