Enterprise Distributed Application Service (EDAS) fully integrates with Container Service for Kubernetes (ACK) on the basis of cloud-native Kubernetes. EDAS supports the full-lifecycle management 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 an image to deploy a Java microservices application in a Kubernetes cluster.

Background information

To deploy applications in an ACK cluster, you must create a cluster in the ACK console and import the cluster to the EDAS console. Then, you can use deployment packages or images to deploy applications in the imported cluster.

Procedure for deploying an application in an ACK cluster

Prerequisites

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.

To create a serverless Kubernetes cluster, set the VPC parameter to Create VPC and set the Service Discovery parameter to PrivateZone. This allows the serverless Kubernetes cluster to use Alibaba Cloud Service Mesh 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.

Create a serverless Kubernetes cluster

Step 2: Import the 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) monitoring component. The ack-arms-prometheus component is a Prometheus monitoring component.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Resource Management > Container Service Kubernetes Clusters.
  3. In the top navigation bar, select the region in which you want to import the cluster, and click Synchronize Container Service Kubernetes Cluster.
  4. In the Actions column of the ACK cluster that you want to import, click Import.
  5. In the Import Kubernetes Cluster dialog box, select the destination microservice namespace from the Microservice Namespaces drop-down list, turn on or off Service Mesh based on your business requirements, and then click Import.
    If the value of the Cluster Status parameter is Running and the value of the Import Status parameter is Imported. for the ACK cluster, the ACK cluster is imported to EDAS.

Step 3: Deploy a Java application in the Kubernetes cluster

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. In the upper part of the page, select a namespace. In the upper-left corner of the Applications page, click Create Application.
  3. In the Basic Information step, set the parameters in the Cluster Type and Application Runtime Environment sections and click Next.
    Configure basic information
    Parameter Description
    Cluster Type The type of the cluster in which you want to deploy the application. Select Kubernetes Clusters.
    Note Kubernetes clusters can be integrated with Alibaba Cloud Service Mesh (ASM).
    Application Runtime Environment
    Hosted Applications The programming language in which the application is developed. In this topic, Java is selected in the example.

    For information about how to deploy a PHP application or a multi-language application, see Build PHP applications from source code and deploy them in ACK clusters and Deploy a microservice-based multi-language application.

    Select Application The runtime environment of the application. You must select a runtime environment based on the programming language and deployment package of the application. In this topic, Custom is selected in the example. A value of Custom indicates that the application can be deployed by using a custom image. If you select Custom, you do not need to select a runtime environment. The image that you use specifies a runtime environment.
    Service Registration and Discovery The O&M method for your service registry. For more information, see Select an O&M method for your service registry.
    Monitoring and Governance Solution The microservices monitoring and governance solution. By default, a Java agent is mounted to the application runtime environment for a Kubernetes cluster to implement fine-grained monitoring. In addition, EDAS provides complete solutions for microservices governance, such as canary releases, service authentication, and throttling and degradation.
  4. In the Configurations step, configure the environment information, basic information, and deployment method for the application, set the related resource parameters, and then click Next.
    Application configurations - Kubernetes - Image
    Parameter Description
    Microservice Namespace The microservices namespace in which you want to deploy the application. If you have not created a microservices namespace or do not select a microservices 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. From the Cluster drop-down list, select the required cluster.

    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 is not in the microservice namespace in which you want to deploy the application.
    K8s Namespace The Kubernetes namespace of the cluster. Internal system objects are allocated to different Kubernetes namespaces to form logically isolated projects, groups, or user groups. This way, these projects, groups, or user groups can be separately managed but still share the resources of the entire cluster. Valid values:
    • default: the default Kubernetes namespace. If no Kubernetes namespace is specified for an object, the default Kubernetes namespace is used.
    • kube-system: the Kubernetes namespace of the objects that are created by the system.
    • kube-public: the Kubernetes namespace that is automatically created and can be read by all users, including users who are not authenticated.

    In this topic, default is selected in the example.

    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 application 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.
    Image Type
    • The type of the image used to deploy the application. Valid values: Configure Image
      • If you select this option, you can set the Alibaba Cloud Container Registry parameter to Current Account.

        In this case, you must also set the Region, Container Registry, Image Repository Namespace, Image Repository Name parameters and select an image version.

      • You can also set the Alibaba Cloud Container Registry parameter to Other Alibaba Cloud Accounts.
    • Demo Image

      If you select this option, you must select a demo image provided by EDAS and then an image version.

      Note Demo images are not provided for Apsara Stack.
    Note Before you use the images in a repository of Container Registry Enterprise Edition to deploy applications as a RAM user, the RAM user must obtain the required permissions from the relevant Alibaba Cloud account. For more information, see Configure policies for RAM users to access Container Registry.
    Total Pods The number of pods on which the application is to be deployed.
    Single-pod Resource Quota The amount of CPU and memory resources that you want to reserve for a pod. To set a limit, enter a numeric value. The default value 0 indicates that no limit is set on the CPU and memory quotas.
  5. Optional. In the Advanced Settings step, configure the advanced settings.
  6. Click Create Application.
    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. For more information, see View the overall information about an application. After the application is deployed, the Application Overview page appears. On this page, you can check the status of the pod. If the pod is in the Running state, the application is released. You can click the state of the pod to view the advanced settings of the application instance, such as Deployment, Pod, and Startup Command.

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 by using this internal-facing SLB instance. For more information, see Bind SLB instances or Reuse an SLB instance.