The traffic adjustment environment is the core of canary release. You must perform traffic adjustment for multiple applications in a traffic adjustment environment. This topic describes how to create a traffic adjustment environment.

Prerequisites

Create a traffic adjustment environment

To configure traffic adjustment rules for High-Speed Service Framework (HSF) applications, you must use Enterprise Distributed Application Service (EDAS) Container V3.5.3 or later.

  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Microservices Governance > HSF. In the navigation tree of the Service Query page, click End-to-end Traffic Adjustment.
  3. On the End-to-end Traffic Adjustment page, click Create Environment in the upper-right corner.
  4. In the Basic Information step, set the Microservice Namespace parameter to specify a region and a microservice namespace, set the Canary Environment Name, Canary Identifier, and Environment Description parameters, and then click Next.
  5. In the Set Inbound Traffic Rule step, select an ingress application and configure traffic adjustment rules. Then, click Next.

    The following table describes the parameters for traffic adjustment rules.

    Parameter Description
    Entrance Application Select an ingress application for the traffic adjustment environment from the drop-down list based on your business requirements.
    Protocol Type Select the protocol type based on your business requirements. Valid values: HTTP and HSF.
    If you set the Protocol Type parameter to HTTP, set the following parameters:
    Path Enter the path in the HTTP requests for the service.
    Conditional Mode If you configure multiple rules, you must configure the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
    Conditions Parameter Type Select the type of the parameter. Valid values: Cookie, Header, and Parameter.
    Parameter Enter a parameter. The parameter can be up to 64 characters in length. For more information about how to configure this parameter, see Throttling rule parameters.
    Conditions Select a condition. Examples: Mod 100 and Whitelist.
    Value Enter a value for the mod operation or list.
    If you set the Protocol Type parameter to HSF, set the following parameters:
    Select Service Select a service in the ingress application. For example, the value is in the format of com.alibaba.edas.demo.api.DempSevice:1.0.0(Service group name).
    Method Select a method in the ingress application. For example, the value is in the format of echoTime(java.lang.String, java.util.List<java.lang.Integer>).
    Conditional Mode If you configure multiple rules, you must configure the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
    Conditions Parameter Select a parameter in the method. For more information about the parameters for HSF traffic adjustment rules, see Throttling rule parameters.
    Expression for Getting Parameter Values Enter a parameter expression to obtain a property of the parameter. Examples:
    • Empty: obtains the value of the parameter.
    • .name: obtains the name property of the parameter. This expression is equivalent to args0.getName().
    • .isEnabled(): obtains the enabled property of the parameter. This expression is equivalent to args0.isEnabled().
    • [0]: indicates that the value of the parameter is an array and obtains the first value of the array. This expression is equivalent to args0[0]. Take note that this expression is not prefixed with a period (.).
    • .get(0): indicates that the value of the parameter is a list and obtains the first value of the list. This expression is equivalent to args0.get(0).
    • .get("key"): indicates that the value of the parameter is a map and obtains the value of the key in the map. This expression is equivalent to args0.get("key").
    Conditions Select a condition.
    • =: supports comparison between strings, numbers, BOOLEAN values, and CHAR values.
    • !=: supports comparison between strings, numbers, BOOLEAN values, and CHAR values.
    • >: supports comparison between numbers.
    • >=: supports comparison between numbers.
    • <: supports comparison between numbers.
    • <=: supports comparison between numbers.
    Value Enter the value of the parameter.
    Note
    • To configure multiple conditions, click Add Rule Condition.
    • To create multiple inbound traffic adjustment rules, click Create Inbound Traffic Rule.
  6. In the Select Application step, select specific applications in the Select Application section based on your business requirements, click the > icon to add the applications to the Selected Applications section, select the application instance group, and then click Next.
    Note
    • Some applications in the Select Application section cannot be selected and have the InfoIcon icon next to them. This indicates that these applications are in the default group. In this case, the applications cannot be added to the traffic adjustment environment.
    • Some application instance groups in the Selected Applications section also have the InfoIcon icon next to them. This indicates that such a group has no instances. In this case, you must add at least one instance to the group. For more information, see Add an instance.
  7. In the Created step, verify the settings of the traffic adjustment environment and click Submit.

Enable the traffic adjustment environment

After the traffic adjustment environment is created, you can turn on Entrance Flow to apply traffic adjustment rules to the ingress application that runs in the traffic adjustment environment. To enable the traffic adjustment environment, perform the following steps:

  1. Go to the End-to-end Traffic Adjustment page.
  2. Select a region and a microservice namespace where the traffic adjustment environment resides.
  3. Find the traffic adjustment environment that you created and turn on Entrance Flow.

Verify the result

After you configure and enable the traffic adjustment environment, you can monitor the canary traffic to verify whether the environment meets your business requirements. For more information, see Monitor canary traffic.