In Enterprise Distributed Application Service (EDAS), you can configure the end-to-end traffic adjustment feature for Spring Cloud and Dubbo microservices-based applications that are deployed in Kubernetes clusters. This feature helps you route traffic with specific characteristics to applications of a specified version.

Prerequisites

Before you configure end-to-end traffic adjustment for applications, you must make sure that the following preparations are made:

Background information

This section describes how to use the end-to-end traffic adjustment feature in the order placement scenario of an e-commerce architecture.

After a customer places an order, the traffic comes in from the ingress application, which can also be a microservice gateway. The ingress application calls the transaction center, the transaction center calls the commodity center, and then the commodity center calls the downstream inventory center.

Both the transaction center and the commodity center are running in new versions V1.0 and V2.0. The two versions need to be verified during a canary release. At this time, you want to route the request traffic that meets specific traffic adjustment rules in the ingress application to applications of the new versions, and route all the remaining traffic to applications of the online version, which is the official version.

Create a lane group

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Microservices Governance > End-to-end Traffic Adjustment.
  3. In the top navigation bar, select a region. On the End-to-end Traffic Adjustment page, select a microservice namespace.
  4. In the lower part of the End-to-end Traffic Adjustment page, click Create Lane Groups and Lanes.
    If a lane group is created in the selected microservice namespace, click Create to the right of the Select swim lane group field.
    Note A microservice namespace can contain up to two lane groups.
  5. In the Create swimlane panel, set relevant parameters and click OK.
    Create a lane group
    Parameter Description
    Microservice Space The microservice namespace that you select on the End-to-end Traffic Adjustment page. The selected microservice namespace cannot be changed.
    Lane group name The name of the lane group. The name can contain uppercase and lowercase letters, digits, hyphens (-), and underscores (_). The name must be 1 to 64 characters in length.
    Entry type The type of the ingress application. Set the value to Entry application (application/gateway deployed in EDAS).
    Note EDAS allows you to use a service gateway that is built based on Spring Cloud Gateway or Spring Cloud Netflix Zuul as an ingress application. The service gateway must be associated with a microservice namespace of EDAS.
    Entry application This parameter is displayed only when the Entry type parameter is set to Entry application (application/gateway deployed in EDAS).
    Swim lane group covers all applications Click Applications involved in adding flow control links and select all applications that are involved based on the ingress application or ingress gateway that you select.
    After the lane group is created, the involved applications of the created lane group are displayed in the Swim lane group involves applications section of the End-to-end Traffic Adjustment page. Check whether the ingress application and the involved applications are properly selected. To modify the information about the lane group, click Edit and modify the information as needed.

Create a lane

  1. On the End-to-end Traffic Adjustment page, select the same microservice namespace as the lane group that you created. Then, click Click to Create the First Split Lane in the lower part of the page.
    Notice After you configure the end-to-end traffic adjustment feature for applications, these applications no longer support a canary release.
  2. In the Create a flow control swimlane panel, set relevant parameters and click OK.
    Parameter Description
    Microservice Space The microservice namespace that you select on the End-to-end Traffic Adjustment page. You must ensure that your lane group is created in the same microservice namespace. The selected microservice namespace cannot be changed.
    Flow control swim lane name The name of the lane. The name can contain uppercase and lowercase letters, digits, hyphens (-), and underscores (_). The name must be 1 to 64 characters in length.
    Receive marking traffic application Click Add Lane Application (not exceeding the lane group range) and select an application in the lane group.
    Note
    • You can select multiple applications for the same lane. You can also create a lane for each application.
    • A lane group can contain up to five lanes.
    • When you create a lane, you can skip the selection of applications that receive the marked traffic. Then, you can select such applications when you edit the created lane.
    Flow Control Rules
    Switch Specifies whether to enable traffic adjustment rules. By default, the switch is turned on.
    Path The HTTP relative path. If you leave this parameter empty, the rules take effect for all paths. Set a value based on your needs.
    Conditional mode The mode in which conditions are met. Select a mode based on your needs. Valid values: Meet the following conditions at the same time and Meet any of the following conditions.
    • Meet the following conditions at the same time: The rules take effect when all the conditions are met at the same time.
    • Meet any of the following conditions: The rules take effect when one of the conditions are met.
    Condition list Click Add rule condition. You can add multiple conditions as needed. You can set different types of conditions, such as Cookie, Header, Parameter, and Body Content.
    In this example, the following conditions are added:
    • The parameter type is Parameter and the condition is env=red. When the condition is met, the traffic is routed to the applications that are running in V1.0.
    • The parameter type is Parameter and the condition is env=blue. When the condition is met, the traffic is routed to the applications that are running in V2.0.
    After the lane is created, the created lane is displayed in the Flow Control Distribution section of the End-to-end Traffic Adjustment page. Check whether the lane name, traffic adjustment rules, and applications that receive the marked traffic are properly configured. To modify the information about the lane, click Edit and modify the information as needed.
  3. Optional:To create more lanes, click Create swimlane in the Flow Control Distribution section and set relevant parameters.
    Note A lane group can contain up to five lanes.

Verify that traffic is routed to specific applications

  1. Use a browser or other tools to access an application in a lane of the lane group multiple times.

    For example, enter http://ip:prt/**?env=red in the address bar of a browser to access the transaction center. The traffic is routed in only one way. This indicates that the traffic with specific characteristics is routed to the desired applications.

    In the path that you entered, ** is the path that you specify in traffic adjustment rules and env=red is a condition in the traffic adjustment rules.

    A2 [172.20.**.**] -> B2 [172.20.**.**] -> C [172.20.**.**]
  2. View the traffic monitoring charts of applications that receive the marked traffic.
    1. On the End-to-end Traffic Adjustment page, select the lane group whose data you want to view.
    2. On the End-to-end Traffic Adjustment page, select a monitoring time. Traffic monitoring charts are refreshed in the Ingress Application Monitoring (total), Ingress Application (Unmarked Part), and Flow Control Distribution sections.
      View the traffic monitoring charts. You can find that almost half of the request traffic is routed to the applications that receive the marked traffic and the following condition is met: Total queries per second (QPS) in the ingress application = QPS in the applications that receive the unmarked traffic + QPS in the applications that receive the marked traffic.

View the traffic monitoring charts of all applications

In addition to the traffic monitoring charts of the ingress application, applications that receive the unmarked traffic, and applications that receive the marked traffic, you can also view the traffic monitoring charts of all applications in the same lane group. You can compare the traffic monitoring charts of all applications to analyze more useful information. Examples:

  • Find the applications that are called at the same time.
  • Analyze traffic escape issues and find out the escaped traffic.