To upgrade Spring Cloud or Dubbo microservice-oriented applications deployed in a Container Service Kubernetes cluster, you can use canary releases to perform a small-scale validation first, and then perform a full upgrade if the validation 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 Applications page, select a region and Namespaces and then click the name of the target application.
  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 right-side Release Strategy Configuration Information section shows the canary release procedure according to the configuration.

      The following describes the release policy parameters:

      • First Grayscale Quantity: the number of application instances in a canary release. The current number of instances for the application is displayed on the right side. To ensure application stability, the number of instances in a canary release cannot exceed 50% of the total number of application instances.
      • Remaining Batch: After a canary release, the remaining application instances are released in specified number of batches.
      • Batch Mode: This parameter is required when Remaining Batch is set to 2 or a larger value. Valid values include Automatic and Manual.

        • Automatic: automatically releases in batches according to Interval. Interval: the release interval for the remaining batches. Unit: minute.
        • Manual: manually triggers the release of the next batch.
      • Batch in Deployment Interval: the deployment interval (unit: second) between application instances if the number of application instances is greater than one in each batch.

    3. Set canary release rules.

      Two canary release rules are provided: Grayscale by Content and Proportional Grayscale.

      • Grayscale by Content: Click Create New Entrance Flow Rules and set a new rule for inbound traffic.
        Note You can create multiple inbound traffic rules.

        Parameters of canary release by content:

        • Protocol Type: select Spring Cloud or Dubbo according to the actual situation of the application.
          • Spring Cloud: Path is required.
          • Dubbo: Select Service and Method are required.
        • Scene Rules: valid values include At the same time meet the following conditions and Meet any of the following conditions.
        • Condition List: conditions for Spring Cloud and Dubbo protocol are different. Three methods are available: Cookie, Header and Parameter. Set the parameters as needed.
          • Spring Cloud: valid values include Cookie, Header and Parameter. Set as required.
          • Dubbo: set Parameters and Parameter value gets the expression based on the actual use of your application.
      • Proportional Grayscale: set Traffic Ratio. Traffic will be forwarded to the current canary instance group according to this value.

    After a canary release is started, deploy the new application version to the specified canary instance group. The Basic Information page prompts that A change process is being executed for this application. Status: {0}. Click View Details. On the Change Details page, view the deployment progress and status.

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

  7. Monitor whether the volume of traffic to the canary instance group meets expectations.
  8. After the traffic verification is completed, click Start the Next Batch on the Change Details page. Complete the subsequent batch release.
    If any issues are found during the verification process, you can click Rollback in the upper-right corner of the Change Details page. In the Rollback dialog box, confirm the impact of rollback, and then click Rollback.

Verify the result

After a canary release, check whether deployment package is the new version on the Basic Information page. On the Instance Information page, view whether the value of Status is Running.