To update a Spring Cloud or Dubbo microservice-oriented application that is deployed in an Elastic Compute Service (ECS) cluster, you can implement a canary release to verify the new version on a small number of instances. If the verification is successful, you can update the application on all instances.

Prerequisites

Before you implement a canary release, make sure that the application contains at least two instance groups and at least two groups contain instances. For more information about how to create instance groups and add ECS instances to the groups, see Manage instance groups of applications deployed in ECS clusters.

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, click Applications.
  3. In the top navigation bar, select a region. On the Applications page, select a microservice namespace and click the name of the application for which you want to implement a canary release.
  4. On the Basic Information page, click Deploy Application in the upper-right corner.
  5. On the Select Deployment Mode page, click Start Deployment in the upper-right corner of the Canary Release (Phased) section.
  6. On the Canary Release page, upload the deployment package of the new application version, set the canary release policy and rules, and then click OK.
    1. Upload the deployment package of the new application version.
      Upload a deployment package for a canary release
    2. In the Release Policy section, set the parameters for the release policy.

      The Publish Policy Configuration section on the right side shows the procedure for the canary release based on the configuration.

      Canary release policy

      The following table describes the parameters for configuring the release policy.

      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 application instances in other groups based on the preset batches.
      • If all groups are selected, the new version is deployed to the instances in each group based on the selected batch number. If the number of instances in a group is less than the selected batch number, the new version is deployed to the instances in the group based on the number of instances.
      • If you have specified a group, the new version is deployed to the instances in the specified group based on the selected batch 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 set this parameter. Valid values: Automatic and Manual.
      • Automatic: automatically deploys the new version to instances in batches based on the release interval. You must set the Wait Time Before Next Batch parameter.

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

      • Manual: manually triggers the release of the next batch.
      Java Environment The runtime environment of the application. Select a runtime environment as needed.
    3. Configure canary release rules.

      Enterprise Distributed Application Service (EDAS) supports Canary Release by Content and Canary Release by Ratio.

      • Canary Release by Content: Click Create Inbound Traffic Rule and create a rule for inbound traffic.
        Note You can create multiple inbound traffic rules.
        Canary release rule - canary release by content

        The following table describes the parameters for creating an inbound traffic rule on the Canary Release by Content tab.

        Parameter Description
        Protocol Type Valid values: Spring Cloud and Dubbo. Select one option based on the actual situation of the application.
        • Spring Cloud: The Path parameter is required.
        • Dubbo: The Select Service and Method parameters are required.
        Conditional Mode Select Meet All Following Conditions or Meet Any of Following Conditions.
        Conditions The conditions for Spring Cloud and Dubbo are different. Three methods are available: Cookie, Header, and Parameter. Set the parameters as needed.
        • Spring Cloud: Cookie, Header, and Parameter are available. Set the parameters as needed.
        • Dubbo: Set the Parameter and Expression for Getting Parameter Values parameters based on the actual values of your application.
      • Canary Release by Ratio: Set the Traffic Ratio paramerter. Traffic is forwarded to the current instance group for the canary release based on this value.

    After the canary release is started, EDAS deploys the new application version to the specified instance group. On the Basic Information page, the message A change process is ongoing for this application. The application is in Executing state appears. Click View Details. On the Change Details page that appears, view the deployment progress and status.

    Stop a change: The application is in the canary release state and this change has been stopped. Please roll back the application before you perform other operations.

  7. You can check whether the traffic is distributed as expected. For more information, see Monitor canary traffic.
  8. After the traffic verification is complete, click Start Next Batch on the Change Details page. Complete the subsequent batch release.
    If an issue occurs during the verification process, click Stop Change in the upper-right corner of the Change Details page. After the change is stopped, on the Basic Information page, the message 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 the deployment package is of the new version on the Basic Information page. On the Instance Information page, check whether the instances are in the Normal state.