Managing Canary Release of Microservice App based on Istio

    KubeSphere provides three kinds of grayscale strategies based on Istio, including blue-green deployment, canary release and traffic mirroring. Without modifying the source code, KubeSphere can realize grayscale, traffic governance, tracing, traffic monitoring and other service mesh features.

    The Bookinfo application is broken into four separate microservices (There are 3 versions of the reviews microservice):

    • Details. The details microservice contains book information.
    • Reviews. The reviews microservice contains book reviews. It also calls the ratings microservice.
    • Ratings. The ratings microservice contains book ranking information that accompanies a book review.

    The end-to-end architecture of the application is shown below, see Bookinfo Application for more details.

    In this tutorial, we’re going to deploy a Bookinfo sample application composed of four separate microservices used to demonstrate the canary release, tracing and traffic monitoring using Istio on KubeSphere.

    • You’ve completed all steps in .
    • You need to turn on the Application Governance to enable the tracing feature. (Choose Project Settings → Internet Access → Edit Gateway → Turn it On)

    1.1. Sign in with account and enter into the demo-project, navigate to Application, click on the Deploy New Application then choose Deploy sample app Bookinfo.

    Canary Release of Microservice APP - 图2

    1.2. Click Create in the pop-up window, then Bookinfo application has been deployed successfully, application components are listed in this following page, as well as the routes and hostname.

    Canary Release of Microservice APP - 图4

    1.3. Next you can access the Bookinfo homepage as following screenshot via Click to visit button. Click on the Normal user to enter into the summary page.

    1.4. Notice that at this point it only shows - Reviewer1 and - Reviewer2 without any stars at the Book Reviews section, this is the initial status of this section.

    Canary Release of Microservice APP - 图6

    Step 2: Create Canary Release for reviews service

    2.1. Back to KubeSphere console, choose Grayscale Release and click on the Create Canary Release Job. **Then select **Canary Release and click Create Job

    2.2. Fill in the basic information, e.g. , click Next and select reviews as the canary service, then click Next.

    Canary Release of Microservice APP - 图9

    2.3. Enter v2 as Grayscale Release Version Number and fill in the new image blank with (i.e. Modify v1 to v2), then click Next.

    2.4. The canary release supports Forward by traffic ratio and Forward by request content, in this tutorial we choose adjust the traffic ratio to manage traffic distribution between v1 and v2. Drag the slider to adjust v2 takes up 30% traffic, and v2 takes up 70%.

    Canary Release of Microservice APP - 图11

    2.5. Click Create when you’ve completed configuration, then you’re able to see the canary-release has been created successfully.

    When you visit the Bookinfo website again and refresh your browser repeatedly, you’ll be able to see that the Bookinfo reviews section switch between v1 and v2 at a random rate of about 30% and 70% respectively.

    Canary Release of Microservice APP - 图13

    Step 4: Inspect the Traffic Topology Graph

    4.1. Connect to your SSH Client, use the following command to introduce real traffic to simulate the access to a bookinfo application every 0.5 seconds.

    4.2. From the traffic management diagram, you can easily see the service invocation and dependencies, health, performance between different microservices.

    4.3. Click on the reviews card. The traffic monitoring graph will come out including real-time data of Success rate, Traffic and Duration.

    Canary Release of Microservice APP - 图15

    KubeSphere provides distributed tracing feature based on Jaeger, which is used for monitoring and troubleshooting microservices-based distributed application.

    5.2. Click any item, you can even drill down to see the request details and this request is being processed by which machine (or container).

    Canary Release of Microservice APP - 图17

    Step 6: Take Over All Traffic

    6.1. As mentioned previously, when the canary version (v2) is released, it could be used to send 70% of traffic to the canary version. Publishers can test the new version online and collect user feedbacks.

    Switch to Grayscale Release tab, click into .

    6.2. Click ··· and select Take Over at reviews-v2. Then 100% of traffic will be sent to the new version (v2).

    Canary Release of Microservice APP - 图19

    6.3. Open the bookinfo page again and refresh the browsers several times. We can find that it only shows the v2 (ratings with black stars) in reviews module.

    When the new version v2 has been released online and takes over all the traffic. Also, the testing results and online users feedback are confirmed to be correct. You can take down the old version and remove the resources of v1.

    Click on the Job Offline button to take down the old version.

    Canary Release of Microservice APP - 图21

    Notice: If take down a specific version of the component, the associated workloads and istio related configuration resources will be removed simultaneously, it turns out that v1 is being replaced by v2.