To upgrade Spring Cloud or Dubbo microservice-oriented applications deployed in an Elastic Compute Service (ECS) cluster, you can use canary release to perform small-scale verification first, and then a full upgrade if the verification succeeds.

Limits

  • Dubbo applications have no restrictions when canary release is used.
  • Spring Cloud applications have the following restrictions when canary release is used:
    • Netflix Zuul and Spring Cloud Gateway are not supported at present.
    • Ingress applications (the first application node that receives external traffic) do not support canary release.

      Ingress applications directly receive external traffic, and because such traffic cannot be intercepted or routed, canary traffic control is temporarily unavailable to ingress applications. An ideal mode is to build a microservice gateway as the "ingress application" to receive external traffic and put all business applications behind it, so as to implement canary traffic control for ingress applications.

    • However, do not use canary release if the application contains the following native features or configurations:

      • Horizontal Pod Autoscaler (HPA)
      • Rancher
      • Istio
      • Features and configurations that are dependent on Deployment.Metadata.Name or Deployment.Metadata.Uid

Procedure

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Application Management > Applications.
  3. On the Applicationspage, select a region and a Namespaces, 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 Start Deployment in the upper-right corner of the Canary Release (Grayscale) 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 for the new application version.
    2. In the Release Strategy section, configure release policy parameters.

      The Release strategy configuration information section on the right shows the canary release process based on the configuration.

      Parameter description:

      • Grayscale Grouping: the group of the instance for canary release.
      • Each Batch after Grayscale: indicates that the application instances in other groups are released based on preset batches after canary release is completed.
        • If all groups are selected, instances in each group are released based on the selected batch number. If the number of instances in a group is less than the selected batch number, the instances in the group are released based on the actual number of batches.
        • If a specific group is selected, instances in the specified group of the application are released based on the selected batch number.
      • Post-gray Scale Batching: When Each Batch after Grayscale is set to 2 or more, you need to configure this parameter. Valid values are Automatic and Manual.

        • Automatic: automatically releases instances in batches based on the release interval. In Automatic mode, you need to configure Batch Wait Time.

          Valid values of Batch Wait Time are Do Not Wait and 1-5 minutes.

        • Manual: manually triggers the release of the next batch.
      • Java Environment: the runtime environment of this application. Valid values are Open JDK 8 and Open JDK 7.
    3. Set the canary release rule.

      Currently, you can select either of the two canary release rules for inbound traffic: Grayscale by Content and Proportional Grayscale.

      • Grayscale by Content: Click Create New of Entrance Flow Rules, and set an inbound traffic rule.
        Note You can create multiple inbound traffic rules.

        Parameter description:

        • Protocol Type: Valid values are Spring Cloud and Dubbo. You can select a protocol type as needed.
          • Spring Cloud: You need to configure path.
          • Dubbo: You need to configure Service and Method.
        • Scene Rules: Valid values are At the Same Time Meet the Following Conditions and Meet Any of the Following Conditions.
        • Conditions List: The conditions for Spring Cloud and Dubbo are different. Valid values are Cookie, Header, and Parameter. Select a condition as needed.
          • Spring Cloud: Valid values are Cookie, Header, and Parameter. Select a condition as needed.
          • Dubbo: Configure Parameters and Parameters Value Gets the Expression to actual ones.
      • Proportional Grayscale: Set Traffic Ratio. Traffic will be forwarded to the current canary instance group according to the configured proportion.

    After canary release is started, the application of the new version is deployed first in the specified canary instance group. On the Basic Information tab, the message A change process is being executed for this application. Status: Executing appears. Click View Details. On the Change Details page that appears, view the deployment progress and status.

    Abort Change: The application is in a canary release and the change has been terminated. Please roll back the app before doing anything else. appears.

  7. Monitor whether the canary traffic meets expectations.
  8. After the canary traffic verification is completed, click Start the Next Batch on the Change Details page. Complete the subsequent batch release.
    If any problems are found during the verification process, you can click in the upper-right corner of the Change Details page. After the change is terminated, on the Basic Information tab, the message The application is in a canary release and the change has been terminated. Please roll back the app before doing anything else. appears.

Verify the result

After a canary release, check whether the version in Deployment Package is the new version on the Basic Information tab. On the Instance Information page, check whether the value of Running Status is Running.