To 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.

Prerequisites

Before you release an application in canary mode, make sure that the application contains at least two instance groups and at least two instance groups contain instances. For more information about how to create instance groups and add ECS instances to the instance groups, see Manage instance groups for an application deployed 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.
  3. In the top navigation bar, select a region. On the Applications page, select a microservices namespace and click the name of the application that you want to release in canary mode.
  4. On the Basic Information page, click Deploy 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, configure release policy parameters.

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

      Canary release policy

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

      ParameterDescription
      Canary GroupsThe instance group for the canary release.
      Batches per Group After Canary ReleaseAfter 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 you have specified a group, 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 ReleaseIf 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: The system automatically deploys the new version to instances in phases based on the specified 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: You need to manually trigger the release of the next batch.
      Java EnvironmentThe 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 Canary Release by Content.

        ParameterDescription
        Protocol TypeThe protocol that is used by the application. Valid values: Spring Cloud and Dubbo. Select one option 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 ModeValid values: Meet All Following Conditions and Meet Any of Following Conditions.
        ConditionsThe 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 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. On the Basic Information tab, 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, view the deployment progress and status.

    If you stop the change, the following message appears: 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 phased 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 tab, the following message appears: 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.