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

  • A group is created. For more information, see Create a group.
  • If you use a RAM user to perform end-to-end traffic adjustment, the RAM user is granted the permissions to view clusters, applications, and services, and manage applications and services. For more information, see Replace EDAS-defined permissions with RAM policies.

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 Traffic Management > Microservices Governance > HSF.
  3. In the navigation tree of the Service Query page, click End-to-end Traffic Adjustment.
  4. On the End-to-end Traffic Adjustment page, click Create Environment in the upper-right corner.
  5. In the Basic Information step, select a region and a microservices namespace from the drop-down lists next to Microservice Namespace, set the Canary Environment Name, Canary Identifier, and Environment Description parameters, and then click Next.
  6. In the Set Inbound Traffic Rule step, select an entrance application and configure traffic adjustment rules. Then, click Next.

    The following table describes the parameters for traffic adjustment rules.

    ParameterDescription
    Entrance ApplicationSelect an entrance application for the traffic adjustment environment from the drop-down list based on your business requirements.
    Protocol TypeSelect 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:
    pathEnter the path in the HTTP requests for the service.
    Conditional ModeIf 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.
    ConditionsParameter TypeSelect the type of the parameter. Valid values: Cookie, Header, and Parameter.
    ParameterEnter a parameter. The parameter can be up to 64 characters in length. For more information about how to configure this parameter, see Traffic adjustment rule parameters.
    ConditionsSelect a condition. Examples: Mod 100 and Whitelist.
    ValueEnter a value for the mod operation or list.
    If you set the Protocol Type parameter to HSF, set the following parameters:
    Select ServiceSelect a service in the entrance application. For example, the value is in the format of com.alibaba.edas.demo.api.DempSevice:1.0.0(Service group name).
    MethodSelect a method in the entrance application. For example, the value is in the format of echoTime(java.lang.String, java.util.List<java.lang.Integer>).
    Conditional ModeIf 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.
    ConditionsParameterSelect a parameter in the method. For more information about the parameters for HSF traffic adjustment rules, see Traffic adjustment rule parameters.
    Expression for Getting Parameter ValuesEnter 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").
    ConditionsSelect 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.
    ValueEnter 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.
  7. 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 Application 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.
  8. 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 the switch next to Inbound Traffic.

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.