Updated on 2025-04-25 GMT+08:00

Service Route Protocols

There are three protocols: HTTP, TLS, and TCP.

A routing rule consists of a group of matching conditions. The corresponding operation is performed on traffic that meets the conditions.

At least one service route protocol must be enabled. A route without matching conditions is required as the default route to avoid access exceptions.

HTTP Service Routing

HTTP is the most common protocol with the most control. It is the most complete protocol supported by ASM. Service meshes process Layer-7 traffic over HTTP.

Table 1 HTTP service routing parameters

match

URI

Identifier of a specific resource, which is of the StringMatch type and can be formatted based on the exact, prefix, or regular expression match.

Enter a URI. You can choose whether to enable Ignore URL case.

Scheme

Protocol used for data collection, which is of the StringMatch type and can be formatted based on the exact, prefix, or regular expression match.

Enter a scheme.

Method

HTTP method, which is of the StringMatch type and can be formatted based on the exact, prefix, or regular expression match.

Enter a method.

Authority

HTTP authority, which is of the StringMatch type and can be formatted based on the exact, prefix, or regular expression match.

Enter an authority.

headers

cookie

An HTTP cookie used to calculate the hash value, which can be formatted based on the exact, prefix, or regular expression match.

Enter a value.

Custom

An HTTP header used to calculate the hash value, which can be formatted based on the exact, prefix, or regular expression match.

Enter a key-value pair.

grayRelease.type.headers.userAgent

Select a user agent as required.

port

Port on the host that is being addressed. Select an available port number from the drop-down list.

queryParams

Query parameter for matching the URL, which can be formatted based on the exact, prefix, or regular expression match.

Enter a key-value pair.

sourceLabels

One or more labels that constrain the applicability of a rule to source (client) workloads with the given labels. Enter a key-value pair of the Map type.

sourceNamespace

Source namespace constraining the applicability of a rule to workloads in that namespace.

Target Service

Version

Select a service subset.

weight

Percentage of traffic received by an instance. The value must range from 0 to 100.

TLS Service Routing

TLS is used to route non-terminated TLS and HTTPS traffic. SNI allows a client to indicate which hostname it is trying to connect to at the start of a TLS handshake.

Table 2 TLS service routing parameters

match

sniHost

SNI to match on. An SNI value must be a subset of the corresponding virtual service's hosts.

destinationSubnets

IPv4 or IPv6 IP addresses of destination with optional subnet.

port

Port on the host that is being addressed.

sourceLabels

One or more labels that constrain the applicability of a rule to source (client) workloads with the given labels. Enter a key-value pair of the Map type.

sourceNamespace

Source namespace constraining the applicability of a rule to workloads in that namespace.

Target Service

Version

Select a service subset.

weight

Percentage of traffic received by an instance. The value must range from 0 to 100.

TCP Service Routing

TCP traffic rules are applied to traffic that does not meet the HTTP and TLS conditions.

Table 3 TCP service routing parameters

match

destinationSubnets

IPv4 or IPv6 IP addresses of destination with optional subnet.

port

Port on the host that is being addressed.

sourceLabels

One or more labels that constrain the applicability of a rule to source (client) workloads with the given labels. Enter a key-value pair of the Map type.

sourceNamespace

Source namespace constraining the applicability of a rule to workloads in that namespace.

Target Service

Version

Select a service subset.

weight

Percentage of traffic received by an instance. The value must range from 0 to 100.