For Spring Cloud or Dubbo microservice-oriented applications that are deployed in a Kubernetes cluster, you can implement a canary release. The canary release allows you to verify a new application version on a small number of instances. If the verification is successful, you can update the application on all of your instances to a new version. This makes the update secure.
- 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 specific features of an application, do not implement a canary release of 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 page, select a namespace.
- 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, set the deployment parameters, release policy, and canary release rules. Then,
- Set 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 current runtime environment of the application. The current runtime environment is displayed only if the application is deployed by using JAR packages or WAR packages. Enterprise Distributed Application Service (EDAS) automatically upgrades the Java environment or application runtime environment of your application 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 a JAR package. This parameter value cannot be changed. Set the parameter based on your requirements. You can select Upload Package and upload a JAR or WAR package. You can also select Package Address and specify the address of a JAR or WAR package. Version (applicable to applications that are deployed by using JAR packages or WAR packages) The version number of the deployment package. You can use a timestamp as the version number. Time Zone (applicable to applications that are deployed by using JAR packages or WAR packages) The time zone for the application. Select a value from the drop-down list as needed. Service Registration and Discovery The O&M method of your service registry. For more information, see Select an O&M method for your service registry.
- In the Release Policy section, set the parameters for the release policy.
Table 2. Parameters in the Release Policy section Parameter Description Number of Instances for Canary Release The number of application instances released in the first batch. The current number of instances for the application appears on the right side. The number of instances for the canary release cannot exceed 50% of the total number of instances. This makes the application stable.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 The Batch Mode parameter is available only if the value of the Remaining Batches parameter is greater than 1.
- Automatic: automatically releases applications in batches based on the interval specified by the Interval parameter. Interval: 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 instances in each batch is greater than 1, the application is deployed to the application instances at the specified interval. Unit: seconds.
The Publish Policy Configuration section on the right side shows the procedure for the canary release based on the configuration.
- Set canary release rules.
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: 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
- Spring Cloud: Set the parameters based on Cookie, Header, or Parameter.
- Dubbo: Set the Parameter and Expression for Getting Parameter Values parameters 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 is distributed as expected. For more information, see Monitor canary traffic.
- Set 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 Roll Back in the upper-right corner of the Change List page. In the message that appears, click OK.
Verify the results
After the canary release is complete, check whether the deployment package is of the new version on the Application Overview page.