Idou Teacher teaches you to learn Istio06: How to use istio to realize traffic migration

Source: Internet
Author: User

Overview

Traffic migration is an important function of traffic management. Istio provides traffic management capabilities to decouple traffic from infrastructure expansion, support dynamic request routing, fault injection, timeout retry, fuse and traffic migration, and more. The primary purpose of traffic migration is to move traffic from one version of the microservices to another, such as traffic switching between the old and new versions. This article describes how to use istio for traffic migration through a simple use case.

This article uses a typical example of a bookinfo. Progressively migrate traffic from reviews version V1 to version v3 with istio command configuration rules. In the example below, the application is based on a weighted routing configuration that will route hundreds of routes in the REVIEWS:V1 version of traffic, progressively migrating all to the Reviews:v3 version. Before you do this, make sure that you have deployed the BookInfo in your current environment and provide an external access address. The specific operations for traffic migration are as follows:

1. Route all traffic to the REVIEWS:V1 version.

2. Enter the external access address in the browser to access the BookInfo app

The page is refreshed at this point and the comments section on the right side of the page will never show rating asterisks. This is because Istio is configured to route all traffic for the reviews service to the REVIEWS:V1 version, and this version of the service does not access the ratings service with the star rating.

3. Transfer 50% of traffic from Reviews:v1 to Reviews:v3:

Wait a few seconds to make sure that the new rules take effect, view the Yaml files, and the weights for V1 and V3 are each 50%:

4. Refresh the page in your browser to see a red star rating on your page with a chance of about 50%.

This is because the V3 version of reviews has access to the ratings service with a red star rating, but the V1 version does not. In the current implementation of istio, this probability is based on a large number of accesses. By increasing the weight of V3 in access rules, you can route more traffic to the V3 version, so you'll see a red star rating more than once.

5. When the V3 version provides a stable service, the user can choose to route all traffic to the V3 version.

Wait a few seconds to make sure the new rule takes effect, view the Yaml file, and all traffic goes to V3 version:

When you refresh the browser interface, you will only see the Red Star rating page.

6. If the current routing rule is no longer used, execute the delete command and delete the routing rule:

Traffic migration is an important function of traffic management, and it has a wide range of application scenarios. In the above practice, use istio weight-based routing to progressively migrate traffic from older versions of the reviews service to the new version. With Istio for traffic migration, the two versions of the reviews service can be scaled and shrunk separately, helping to manage the microservices independently, without affecting the distribution of traffic between versions. Instead of using the deployment capabilities of the container orchestration Platform for version migration, the actual use of instance expansion to manage traffic is not the same principle.

Welcome attention to the public number "container cube", if you want to join the container communication technology Group, add Administrator Monicka, apply for the group, the container circle of people look over ~

Idou Teacher teaches you to learn Istio06: How to use istio to realize traffic migration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.