To update Spring Cloud or Dubbo microservice-oriented applications that are deployed in an Elastic Compute Service (ECS) cluster, you can perform a canary release.

Prerequisites

Make sure that the application has at least two instance groups, and at least two groups have ECS instances. For information about how to create an instance group and add ECS instances to the group, see Manage instance groups of applications deployed in ECS clusters and .

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. On the Applications page, select a region, select a namespace from the Namespaces drop-down list, and then click the application name.
  4. On the application details page, click Deploy Application in the upper-right corner.
  5. On the Select Deployment Mode page, click Canary Release (Phased) in the upper-right corner of the 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 Confirm.
    1. Upload the deployment package of the new application version.
      Canary release-upload the deployment package
    2. In the Release Strategy section, configure release policy parameters.

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

      Canary release-release policy

      Parameters

      Parameter Description
      Canary Groups The instance groups that are used for the canary release.
      Batches per Group After Canary Release The number of batches. The instances in other groups are released based on the specified number of batches after the canary groups are released.
      • If all groups are selected, the instances in each group are released based on the specified number of batches. If the number of instances in a group is less than the specified number of batches, the instances in the group are released based on the actual number of instances.
      • If a specific group is selected, the instances in the group are released based on the specified number of batches.
      Batch Type for Scale-out After Canary Release If you set Batches per Group After Canary Release to a value of at least 2, you must specify this parameter. Valid values: Automatic and Manual.
      • Automatic: automatically releases instances in batches based on the release interval. You must specify the Wait Time Before Next Batch parameter.

        Valid values of the Wait Time Before Next Batch parameter are Do Not Wait and 1 to 5 minutes.

      • Manual: manually triggers the release of the next batch.
      Java Environment The runtime environment of the application. Specify this parameter based on your business requirements.
    3. Set canary release rules.

      Two canary release rules are provided: Canary Release by Content and Canary Release by Ratio.

      • Canary Release by Content: Click Create New Entrance Flow Rules and set a new rule for inbound traffic.
        Note You can create multiple inbound traffic rules.
        Canary release rule-canary release by content

        Parameters

        Parameter Description
        Protocol Type Valid values: Spring Cloud and Dubbo. Specify this parameter based on your business requirements.
        • Spring Cloud: You must specify the Path parameter.
        • Dubbo: You must specify the Service and Method parameters.
        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: Valid options include Cookie, Header, and Parameter. Specify this parameter based on your business requirements.
        • Dubbo: Valid options include Parameters and Expression for Getting Parameter Values. Specify this parameter based on your business requirements.
      • Canary Release by Ratio: set the Traffic Ratio parameter. Traffic is forwarded to the current canary group based on the specified ratio.

    After a canary release is started, deploy the new application version to the specified canary group. The following message appears on the Basic Information page: A change process is being executed for this application. Status: Executing. Click View Details. On the Change Details page, view the deployment progress and status.

  7. Check whether the traffic is distributed to the canary group as expected. For more information, see Monitor canary traffic.
  8. After the traffic verification is completed, click Start the Next Batch on the Change Details page.
    If any issues are found during the verification process, you can click Stop Change in the upper-right corner of the Change Details page. After the change is terminated, the following message appears on the Basic Information page: The application is in the canary release state and this change has been stopped. Roll back the application before you perform other operations.

Verify the result

After a canary release is completed, check whether the new application version is displayed for the Deployment Package parameter on the Basic Information page. On the Instance Deployment Information page, check whether the value of Status is Running.