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
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.
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.
Log on to the EDAS console.
In the left-side navigation pane, choose . 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.
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.
On the Canary Release (Phased) page, configure parameters based on your business requirements and click OK.
Upload the deployment package of the new application version.
In the Release Policy section, configure release policy parameters.
The Publish Policy Configuration section shows the canary release process based on the configuration.
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.
The runtime environment of the application. Select a runtime environment based on your business requirements.
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.
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.
Valid values: Meet All Following Conditions and Meet Any of Following 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.
Check whether the traffic is distributed as expected. For more information, see Monitor canary traffic.
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.