Java agents support end-to-end canary release based on Kubernetes service discovery. Spring Boot applications are unable to connect to third-party registries. Due to this reason, Spring Boot applications deployed in Kubernetes clusters call other applications based on Kubernetes service discovery. This topic describes how to use Microservices Engine (MSE) to implement an end-to-end canary release for Spring Boot applications deployed in Kubernetes clusters.
Prerequisites
A Kubernetes cluster is created. For more information, see Create an ACK managed cluster and Create an ACK Serverless cluster.
MSE Microservices Governance Enterprise Edition is activated and a microservice namespace is created.
The MSE Microservices Governance component named ack-onepilot is installed. For more information, see Install and update the Microservices Governance component. We recommend that you install the ack-onepilot component of version 3.3.x or later.
Advanced governance capabilities are enabled for your Kubernetes cluster. For more information, see Enable advanced governance for Kubernetes clusters.
NoteIf the version of your ack-onepilot component is 4.x or later, wait about 10 minutes for the advanced governance capabilities to take effect. You can also restart ack-onepilot and redeploy applications. The latency issue will be resolved soon.
Limits
This feature is in public preview and is only available in the following regions: China (Beijing), China (Shanghai), China (Hangzhou), China (Shenzhen), China (Zhangjiakou), US (Silicon Valley), and Singapore. Other regions are not supported.
For the HTTP frameworks and their versions supported when Spring Boot applications call other applications, see Frameworks supported by Microservices Governance.
This feature is in public preview, and you must set the Java agent version to 4.2.5-proxyless. For more information about how to specify the agent version, see Specify the agent version.
Demo overview
In this demo, applications are deployed in the ACK console. The following figure shows the architecture of demo applications. Application call scenarios involve discovery of Spring Cloud applications based on Nacos instances and discovery of Spring Boot applications based on Kubernetes services.
Gateway: works as a Spring Cloud gateway. It is used as an ingress for backend traffic and calls Application A based on Nacos service discovery.
A: a Spring Cloud application. Its nodes are registered with a Nacos instance for service discovery. Application A calls Application B based on Kubernetes service discovery and calls Application D based on Nacos service discovery.
B: a Spring Boot application. It calls Application D based on Kubernetes service discovery.
D: a Spring Cloud application. Its nodes are registered with a Nacos instance for service discovery.
Procedure
Step 1: Deploy base and canary applications
Log on to the ACK console.
In the left-side navigation pane, click Clusters. Then, click the name of the cluster that you want to manage.
In the left-side navigation pane, choose .
In the upper part of the page, select the namespace of the cluster, and click Create from YAML.
Use the following YAML code to deploy applications.
Step 2: Configure the end-to-end canary release feature
Log on to the MSE console, and select a region in the top navigation bar.
In the left-side navigation pane, choose .
On the Full link grayscale page, select
mse-springboot-demofrom the microservice namespace drop-down list.If no lane group has been created in the selected microservice namespace, click Create Lane Group and Lane. If a lane group has already been created in the selected microservice namespace, click + Create Lane Group.
In the Create Lane Group panel, configure the parameters, and click OK.
Parameter
Example
Lane Group Name
Enter a custom name for the lane group, such as mse-springboot-demo.
Ingress Type
Select Java Microservice Gateway.
Lane Group Traffic Entry
Select spring-cloud-gateway.
Lane Group Application
Select spring-cloud-a, spring-boot-b, and spring-cloud-d.

If no lane has been created in the selected microservice namespace, click Create First Split Lane in the lower part of the Full link grayscale page. If a lane has already been created in the selected microservice namespace, click Create Lane.
In the Create Lane panel, configure the parameters, and click OK.
Parameter
Description
Add Node Tag
Add a tag for canary application nodes to distinguish them from base application nodes.
Enter lane information
Lane Name: Enter an informative lane name.
Lane Tag: Enter a tag name for matched traffic in this lane. In this example, this parameter is set to gray.
Confirm Matching Relationship: Check whether the number of application nodes that have the specified tag meets your expectations.
Lane Status: Turn on the switch.
Add Canary Release Rule
Specify the rule for routing requests to application nodes in the lane.
Canary Release Mode: Select Canary Release by Content.
Canary Release Condition: Select Meet All Conditions.
Configuration details in this example:
Parameter Type: Select
Header.Parameter: Enter
x-springboot-demo.Condition: Select
==.Value: Enter
1.

Step 3: Verify the result
Log on to the ACK console.
In the left-side navigation pane, click Clusters. Then, click the name of the cluster that you want to manage.
In the left-side navigation pane of the Cluster Information page, choose Network > Services. On the Services page, copy the external IP address of
spring-cloud-gateway-slb, and perform the following verification operations.Verify the result in the base environment
Send a request to the Spring Cloud gateway based on the route
/A/A/a, and check that all traffic is routed to the base nodes. This indicates that the end-to-end canary release configuration is effective.# Test command curl http://xxx.xx.131.81/A/A/a # Test result A:192.168.0.17:base -(java)- B:192.168.100.231:base - D:192.168.0.19:baseVerify the result in the canary environment
Send a request to the Spring Cloud gateway based on the route
/A/A/aand addx-springboot-demo=1toHeader. Check that all traffic is routed to the canary nodes. This indicates that the end-to-end canary release configuration is effective.# Test command curl -H "x-springboot-demo:1" http://xxx.xx.131.81/A/A/a # Test result A:192.168.100.234:gray -(java)- B:192.168.0.21:gray - D:192.168.0.14:grayTab 2 Body