Canary Release

    This method serves as an efficient way to test performance and reliability of a service. It can help detect potential problems in the actual environment while not affecting the overall system stability.

    Step 1: Create a Canary Release Job

    1. Log in to KubeSphere as project-regular and navigate to Grayscale Release. Under Release Modes, click Create on the right of Canary Release.

    2. Set a name for it and click Next.

    3. On the Service Settings tab, select your app from the drop-down list and the Service for which you want to implement the canary release. If you also use the sample app Bookinfo, select reviews and click Next.

    4. On the New Version Settings tab, add another version of it (e.g kubesphere/examples-bookinfo-reviews-v2:1.16.2; change to v2) and click Next.

    5. You send traffic to these two versions (v1 and v2) either by a specific percentage or by the request content such as , Cookie and URI. Select Specify Traffic Distribution and move the slider to the middle to change the percentage of traffic sent to these two versions respectively (for example, set 50% for either one). When you finish, click Create.

    Now that you have two available app versions, access the app to verify the canary release.

    1. Visit the Bookinfo website and refresh your browser repeatedly. You can see that the Book Reviews section switching between v1 and v2 at a rate of 50%.

    2. You can see half of the traffic goes to each of them.

    3. The new Deployment is created as well.

    4. Expected output:

    Step 3: View Network Topology

    1. Execute the following command on the machine where KubeSphere runs to bring in real traffic to simulate the access to Bookinfo every 0.5 seconds.

      Note

      Make sure you replace the hostname and port number in the above command with your own.

    2. In Traffic Monitoring, you can see communications, dependency, health and performance among different microservices.

    KubeSphere provides the distributed tracing feature based on , which is used to monitor and troubleshoot microservices-based distributed applications.

    1. On the Tracing tab, you can see all phases and internal calls of requests, as well as the period in each phase.

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

    Step 5: Take Over All Traffic

    If everything runs smoothly, you can bring all the traffic to the new version.

    1. In Release Jobs, click the canary release job.

    2. Access Bookinfo again and refresh the browser several times. You can find that it only shows the result of reviews v2 (i.e. ratings with black stars).