New versions are released continuously during application iterations. Before you release a new version, you can use traffic adjustment rules to verify the new version on a small number of instances. After the verification succeeds, you can upgrade the applications on all instances to the new version. You can use HSF and HTTP traffic adjustment rules. This topic describes these two rules.

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.

Configure an HTTP traffic adjustment rule

You can specify the URL and use the Cookie value, Header value, or URL parameter to distribute the traffic based on the whitelist or the range of the remainder of Mod 100.

Important If you configure HTTP traffic adjustment rules for multiple groups of an application, only the last rule takes effect.
  1. Log on to the EDAS console.
  2. In the left-side navigation pane, choose Application Management > Applications. In the top navigation bar, select the region. In the upper part of the Applications page, select the microservices namespace from the Microservice Namespace drop-down list and then click the name of the desired application.
  3. On the application details page, click the Basic Information tab. In the Application Settings section, click Enable next to Traffic Management.
    If the traffic management feature is not enabled, you cannot configure HTTP traffic adjustment rules.
  4. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the canary instance group section and click HTTP Traffic Adjustment.
  5. In the Traffic Adjustment dialog box, select Enable the following configuration to control HTTP request traffic that enters the current application instance group.
  6. In the Traffic Adjustment dialog box, configure the parameters. Then, click Save.

    You can configure one of the following traffic adjustment rules for inbound traffic: Canary Release by Content and Canary Release by Ratio.

    • Canary Release by Content: distributes traffic that meets the configured rule to the canary instance group.
    • Canary Release by Ratio: distributes traffic to the canary instance group based on a specific proportion.
    The following list describes how to configure the two rules:
    • Configure the Canary Release by Content rule
      1. In the Traffic Adjustment dialog box, click the Canary Release by Content tab.
      2. On the tab, configure the parameters.
      Parameter Description
      path Enter the path in the HTTP requests for the service.
      Conditional Mode If multiple rules are configured, you must configure the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
      Condition list Parameter Type Valid values: Cookie, Header, and Parameter.
      Parameter Enter the parameter name. The name can be up to 64 characters in length. For more information about the writing specifications and examples, see traffic adjustment rule parameters.
      Conditions Select a condition. Valid values: =, !=, >, <, >=, <=, White List, and Mod 100.
      Value Enter a value for the mod operation or list.
    • Configure the Canary Release by Ratio rule
      1. In the Traffic Adjustment dialog box, click the Canary Release by Ratio tab.
      2. On the tab, specify Traffic Ratio. The value must be a positive integer. Valid values: 1 to 100. Example: 40.

Configure an HSF traffic adjustment rule

You can specify a service or a method, use the parameter value of the method, and use the remainder range of Mod 100 or the list as the condition to distribute the traffic.

  1. On the Instance Information tab, click Traffic Adjustment in the upper-right corner of the canary instance group section and click HSF Traffic Adjustment.
  2. In the Traffic Adjustment dialog box, select Enable the following configuration to control the HSF request volume that enters the current application instance group.
  3. In the Traffic Adjustment dialog box, configure the parameters. Then, click Save.
    You can configure one of the following traffic adjustment rules for inbound traffic: Canary Release by Content and Canary Release by Ratio.
    • Canary Release by Content: distributes traffic that meets the configured rule to the canary instance group.
      1. In the Traffic Adjustment dialog box, click the Canary Release by Content tab.
      2. On the tab, configure the parameters.
        Parameter Description
        Select Service Select a service in the ingress application from the drop-down list.
        Method Select a method in the service that you select in the ingress application. If you do not select a method, all requests that access the service are matched based on the rule.
        Conditional Mode If multiple rules are configured, you must configure the conditions for these rules to take effect. Valid values: Meet All Following Conditions and Meet Any of Following Conditions.
        Condition list Parameter Parameters in the service and method are automatically listed and named in the format of parameteri. i indicates the serial number of the parameter. The serial number starts from 0.
        Expression for Getting Parameter Values The expression is concatenated by two fields in the format of argsi.xxx. The first field argsi depends on the parameter you select. If you select parameter0, the argsi field is args0. The second field .xxx is customized based on your requirements. For more information about the writing specifications and examples, see traffic adjustment rule parameters.
        Conditions Select a condition. Valid values: =, !=, >, <, >=, <=, White List, and Mod 100.
        Value Enter a parameter value. A string must be enclosed in double quotation marks (""). If the value is of the BOOLEAN type, the valid value is true or false.
    • Canary Release by Ratio: distributes traffic to the canary instance group based on a specific proportion.
      1. In the Traffic Adjustment dialog box, click the Canary Release by Ratio tab.
      2. On the tab, specify Traffic Ratio. The value must be a positive integer. Valid values: 1 to 100. Example: 40.

Verify the traffic adjustment rule

After you configure and enable a traffic adjustment rule, you can monitor the canary traffic to verify whether the traffic destined for the canary instance group meets your expectations. For more information, see Monitor canary traffic.