When deploying new versions of microservices, a full rollout risks exposing all users to potential issues. A canary release mitigates this by deploying the new version to a small subset of instances first. After you verify that the canary instances are healthy, you promote the new version to the remaining instances in batches.
This topic describes how to perform a canary release for Spring Cloud and Dubbo microservices in Kubernetes clusters through the Enterprise Distributed Application Service (EDAS) console.
How it works
A canary release in EDAS follows this lifecycle:
EDAS creates a canary instance group and deploys the new version to the number of instances you specify.
Traffic routes to the canary group based on a rule you configure: content-based matching, percentage-based splitting, or lane-based routing.
You monitor the canary traffic to verify that the new version behaves as expected.
After verification passes, you manually approve promotion -- deploying the new version to the remaining instances in one or more batches.
If issues arise, you can roll back the canary group to the previous version.
The canary batch requires manual approval before the remaining batches begin. EDAS does not automatically promote the canary to full rollout.
Limits
| Application type | Canary release support |
|---|---|
| High-Speed Service Framework (HSF) | Not supported. |
| Dubbo | Supported without restrictions. |
| Spring Cloud | Supported. Do not use canary release if the application relies on Deployment.Metadata.Name or Deployment.Metadata.Uid to configure features. Otherwise, the native features of the application may be abnormal after the canary release. |
| Ingress applications | Supported with limitations. If a Server Load Balancer (SLB) instance forwards traffic directly to the application, SLB traffic forwarding does not follow the canary release policy. |
To use canary release with an ingress application, create a client application and a server application with multiple replicas. Run the canary release on the server application, then associate the SLB instance with the client application for external traffic.
Start a canary release
Before you begin
Make sure that you have:
A Spring Cloud or Dubbo application deployed in a Kubernetes cluster managed by EDAS
Access to the EDAS console
(If using Container Registry Enterprise Edition) The
aliyun-acr-credential-helpercomponent installed in the cluster. For details, see Use the aliyun-acr-credential-helper component to pull images without using a secret.(If using Container Registry Enterprise Edition) VPC access configured for the image repository. For details, see Configure a VPC ACL.
Procedure
Log on to the EDAS console.
In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select a region. In the upper part of the page, select a microservices namespace from the Microservices Namespace drop-down list.
On the Applications page, select Kubernetes Cluster from the Cluster Type drop-down list. Click the name of the application for which you want to perform a canary release.
In the upper-right corner of the Application Overview page, choose Deploy > Deploy. On the Set Deployment Mode page, click Start Deployment in the Canary Release (Phased) section.
On the Canary Release (Phased) page, configure the deployment method, release policy, and canary release rule, then click OK. The following sections describe each configuration area.
Monitor and promote the release
After the canary batch is deployed, EDAS displays the deployment progress and status on the Upgrade History page.
Verify that traffic is distributed as expected. For details, see Monitor canary traffic.
If the canary instances are healthy, go to the Change List page and click Start the Next Batch to promote the release to subsequent batches.
Repeat until all batches are complete.
Roll back a release
If issues arise during canary verification:
On the Change List page, click RollBack in the upper-right corner.
In the confirmation dialog box, click OK.
Verify the release
After all batches complete, confirm the application runs the new version:
Go to the Application Overview page of the application.
In the Deployment specifications section, check that the deployment package version matches the newly deployed version.