All Products
Search
Document Center

Enterprise Distributed Application Service:Release an application in canary mode in an ECS cluster in the EDAS console

Last Updated:Feb 05, 2024

To ensure security when you update a Spring Cloud or Dubbo microservices application that is deployed in an Elastic Compute Service (ECS) cluster, you can release the application in canary mode to verify the new version on a small number of instances. If the verification is successful, you can update the application on all instances. This topic describes how to release an application in canary mode in an ECS cluster by using the Enterprise Distributed Application Service (EDAS) console

Prerequisites

Before you release an application in canary mode, make sure that the application contains at least two instance groups that contain instances. For more information about how to create instance groups and add ECS instances to the instance groups, see Manage an instance group in an ECS cluster in the EDAS console.

Limits

  • High-Speed Service Framework (HSF) applications: Canary release is not supported.

  • Dubbo applications: You can implement canary releases of Dubbo applications without limits.

  • Spring Cloud applications: If you use Deployment.Metadata.Name or Deployment.Metadata.Uid to configure some features of an application, do not implement a canary release for the application. Otherwise, the native features of the application may be abnormal after the canary release.

Procedure

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the Applications page, select a microservices namespace from the Microservices Namespace drop-down list. Then, click the name of the application that you want to manage.

  3. In the upper-right corner of the Basic Information page, click Deploy Application. In the upper-right corner of the Select Deployment Mode page, click Start Deployment in the Canary Release (Phased) section.

  4. On the Canary Release (Phased) page, configure parameters based on your business requirements and click OK.

    1. Upload the deployment package of the new application version.

      灰度发布-上传部署包

    2. In the Release Policy section, configure release policy parameters.

      灰度发布-发布策略

      The Publish Policy Configuration section shows the canary release process based on the configuration.

      Parameter

      Description

      Canary Groups

      The instance group for the canary release.

      Batches per Group After Canary Release

      After the canary release for the specified instance group is complete, the new version is deployed to instances in other groups based on the preset phases.

      • If all groups are selected, the new version is deployed to the instances in each group based on the selected phase number. If the number of instances in a group is less than the selected phase number, the new version is deployed to the instances in the group based on the number of instances.

      • If a specific group is selected, the new version is deployed to the instances in the specified group based on the selected phase number.

      Batch Type for Scale-out After Canary Release

      If you set the Batches per Group After Canary Release parameter to a value of at least 2, you must configure this parameter. Valid values: Automatic and Manual.

      • Automatic: The system automatically deploys the new version to instances in phases based on the specified interval. You must configure the Wait Time Before Next Batch parameter.

        Valid values of Wait Time Before Next Batch include Do Not Wait, 1 Minutes, 2 Minutes, 3 Minutes, 4 Minutes, and 5 Minutes.

      • Manual: You must manually trigger the release of the next batch.

      Java Environment

      The runtime environment of the application. Select a runtime environment based on your business requirements.

    3. Configure canary release rules. EDAS supports the following canary release rules: Canary Release by Content and Canary Release by Ratio.

      • Canary Release by Content: Click Add Policy. In the Add a canary release by content policy panel, click + Create Inbound Traffic Rule to create a rule for inbound traffic.

        Note

        You can create multiple inbound traffic rules.

        灰度规则-按内容灰度

        Parameter

        Description

        Protocol Type

        The protocol that is used by the application. Valid values: Spring Cloud and Dubbo. Configure this parameter based on the actual protocol of the application.

        • Spring Cloud: The Path parameter is required.

        • Dubbo: The Select Service and Method parameters are required.

        Conditional Mode

        Valid values: Meet All Following Conditions and Meet Any of Following Conditions.

        Conditions

        The conditions for Spring Cloud and Dubbo are different.

        • Spring Cloud: Cookie, Header, and Parameter are available. Configure the parameters based on your business requirements.

        • Dubbo: configure the Parameter and Expression for Getting Parameter Values parameters based on the actual values of your application.

      • Canary Release by Ratio: configure the Traffic Ratio parameter. Traffic is forwarded to the current instance group for the canary release based on this value.

    After the canary release is started, the new application version is deployed to the specified instance group. The deployment progress and status are displayed on the Change Details page.

  5. Check whether the traffic is distributed as expected. For more information, see Monitor canary traffic.

  6. After the traffic verification is complete, click Start Next Batch on the Change Details page to complete the subsequent phased release.

    If an issue occurs during the verification process, you can click Stop Change in the upper-right corner of the Change Details page. After the change is stopped, the following message appears on the Basic Information tab: The application is in the canary release state and this change has been stopped. Please roll back the application before you perform other operations.

Verify the result

After the canary release is complete, check whether Deployment Package is of the new version on the Basic Information tab. On the Instance Information tab, check whether the instances are in the Normal state.