Assume that you have deployed a Spring Cloud or Dubbo microservice application to a Kubernetes cluster. In this case, you can implement a canary release to verify a new application version on a small number of instances. After the verification is successful, you can upgrade the application on all of your instances to the new version. This secures the upgrade operations.
- 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, click Applications. In the top navigation bar, select a region. In the upper part of the Applications page, select a microservice namespace.
- On the Applications page, select Container Service or Serverless Kubernetes Cluster from the Cluster Type drop-down list. Then, click the name of the application that you want to deploy.
- In the upper-right corner of the Application Overview page, choose .
- In the Canary Release (Phased) section of the Select Deployment Mode page, click Start Deployment in the upper-right corner.
- On the Canary Release (Phased) page, configure the deployment parameters, release policy, and canary release rules.
Then, click OK.
- Configure the deployment parameters.
Table 1. Deployment parameters Parameter Description Configure Image (applicable to only applications that are deployed by using images) You can update the version of an image, but cannot change the image of an application. Application Runtime Environment (applicable to applications that are deployed by using JAR packages or WAR packages) The value must be the same as that used for the previous deployment.
- JAR package: The application runtime environment is Standard Java Application Runtime Environment. You cannot change the type of the application runtime environment.
- WAR package: The application runtime environment is Apache Tomcat. You cannot change the type of the application runtime environment. However, you can change the version of Apache Tomcat as needed.
Java Environment (applicable to applications that are deployed by using JAR packages or WAR packages) Select a value from the drop-down list as needed. Current Environment The environment in which the application is running. This parameter is available only for applications that are deployed by using JAR packages or WAR packages. EDAS automatically upgrades the Java environment or application runtime environment to the latest version. File Uploading Method (applicable to applications that are deployed by using JAR packages or WAR packages) The type of the deployment package must be the same as that used for the previous deployment. You can use a WAR package or JAR package. This parameter value cannot be changed. Select Upload JAR Package or Upload WAR Package as needed. You can also specify JAR Package Address or WAR Package Address. Version (applicable to applications that are deployed by using JAR packages or WAR packages) The version of the deployment package. You can select Use Timestamp as Version Number. Time Zone (applicable to applications that are deployed by using JAR packages or WAR packages) Select a value from the drop-down list as needed.
- In the Release Policy section, configure the release policy parameters.
Table 2. Release policy parameters Parameter Description Number of Instances for Canary Release The number of application instances for the release of the first batch. The current number of instances on which the application is deployed appears on the right side. For application stability, the number of instances for the canary release cannot exceed 50% of the total number of application instances.Note After the canary release is implemented, you must manually release the remaining batches. Remaining Batches After the release of the first batch is complete, the application is deployed to the remaining application instances based on the specified batches. Batch Mode The following processing methods are supported:
Note Batch Mode is available only when Remaining Batches is greater than 1.
- Automatic: automatically releases applications in batches based on Interval. Interval specifies the interval for releasing the remaining batches in minutes.
- Manual: manually triggers the release of the next batch.
Deployment Interval Between Batches If the number of application instances in each batch is greater than 1, the application is deployed to the application instances at the specified interval. Unit: second.
The Publish Policy Configuration section on the right side shows the procedure for the canary release based on the configuration.
- Set canary release rules.
Enterprise Distributed Application Service (EDAS) supports Canary Release by Content and Canary Release by Ratio.
Table 3. Parameters for canary release rules Tab Parameter Description Canary Release by Content Protocol Type
- Spring Cloud: Path is required.
- Dubbo: Select Service and Method are required.
Conditional Mode Select Meet All Following Conditions or Meet Any of Following Conditions. Conditions
- Spring Cloud: Configure the parameters based on Cookie, Header, or Parameter.
- Dubbo: Set Parameter and Expression for Getting Parameter Values based on the actual values of your application.
Canary Release by Ratio Traffic Ratio Traffic is forwarded to the current instance group for the canary release based on the specified value.Note Click Create Inbound Traffic Rule to create multiple inbound traffic rules that can take effect at the same time.
- Optional:Configure the advanced settings.
After the canary release is started, EDAS deploys the new application version to the specified instance group. The Change List page displays the deployment progress and status.Note You can check whether the traffic distributed to the instance group for the canary release meets your expectations by monitoring. For more information, see Monitor canary traffic.
- Configure the deployment parameters.
- After the traffic for the canary release is verified, click Start Next Batch on the right side of the Change List page. Complete the release of the subsequent batches. If problems are found during the verification process, you can click Rollback in the upper-right corner of the Change List page. In the Confirmation dialog box, click OK.
Verify the result
After the canary release is complete, check whether the deployment package is of the new version on the Application Overview page.