For Spring Cloud or Dubbo microservices 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 the new version. This makes the update secure.

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. In the top navigation bar, select the region. In the upper part of the Applications page, select the microservices namespace from the Microservice Namespace drop-down list.
  3. 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.
  4. In the upper-right corner of the Application Overview page, choose Deploy > Deploy.
  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 (Phased) page, configure the deployment parameters, release policy, and canary release rules. Then, click OK.
    1. Configure the deployment parameters.
      Table 1. Deployment parameters
      Parameter Description
      Configure Image (applicable only to 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 updates 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 JAR package. This parameter value cannot be changed. Set the parameter based on your requirements. You can select Upload JAR Package or Upload WAR Package. Alternatively, you can specify the JAR Package Address or WAR Package Address.
      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 for your service registry. For more information, see Select an O&M method for your service registry.
    2. In the Release Policy section, configure release policy parameters.
      Table 2. Parameters in the Release Policy section
      Parameter Description
      Number of Instances for Canary Release The number of application instances for the release of the first batch. You can view the total number of instances on the right side of this parameter. To ensure application stability, we recommend that you set this parameter to a value less than half of the total number of instances.
      Note After the canary release is implemented, you must manually release the remaining batches.
      Remaining Batches The number of remaining batches to release the application. 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:
      • 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.
      Note The Batch Mode parameter is displayed only if the value of the Remaining Batches parameter is greater than 1.
      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: seconds.

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

    3. Configure canary release rules.

      EDAS supports the following canary release rules: 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: Configure 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 You can click Create Inbound Traffic Rule to create multiple inbound traffic adjustment rules that can take effect at the same time.
    4. Optional: Configure advanced settings.

    After a canary release is started, EDAS deploys the new version of the application to the specified canary instance group. The deployment progress and status are displayed on the Upgrade History page.

    Note You can check whether the traffic is distributed as expected. For more information, see Monitor canary traffic.
  7. After the traffic for the canary release is verified, click Start the Next Batch on the right side of the Change List page. Complete the release of the subsequent batches.
    If an issue occurs during the verification, you can click RollBack in the upper-right corner of the Change List page. In the dialog box that appears, 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.