MSE gateway routing

更新时间:
复制 MD 格式

When your microservices run across different backends -- ACK clusters, EDAS registries, and MSE Nacos instances -- you need a unified entry point to direct external HTTP traffic to the correct service. Enterprise Distributed Application Service (EDAS) allows you to configure Microservices Engine (MSE) gateway routes for applications that are deployed in a Kubernetes cluster, providing path-based, header-based, and parameter-based routing.

Prerequisites

Before you begin, make sure that you have:

  • An EDAS account with access to the EDAS console

  • At least one application deployed in a Kubernetes cluster managed by EDAS

  • An MSE cloud-native gateway associated with your Container Service for Kubernetes (ACK) cluster

  • (Optional) Domain names configured on the Domain Names page in the MSE console

Route matching rules

A route matches a request only when all conditions in its rule are met. Adding more conditions narrows the set of matched requests.

Path match types

Match typeBehaviorExample
Prefix MatchMatches requests whose path starts with the specified value./user
Exact MatchMatches only when the request path is identical to the specified value./user
Regex MatchMatches requests whose path satisfies a regular expression.A regular expression pattern

Route evaluation order

When multiple routes can match a request, the gateway evaluates them in the following order:

  1. Routes are evaluated in their display order on the MSE Gateway Routes page.

  2. For path-based rules with the same match type, longer path values take higher priority. For example, /api/v1/users takes priority over /api.

  3. For header or query parameter rules, more specified parameters mean higher priority. For example, a route that matches both X-Env: prod and X-Region: us takes priority over a route that matches only X-Env: prod.

Supported backend service types

Service sourceWhen to use
ACK ContainerYour destination service runs as a Kubernetes service in an ACK cluster.
EDAS Registration CenterYour destination service is registered in an EDAS registry.
MSE NacosYour destination service is registered on an MSE Nacos instance.

Create a route

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Traffic Management > Application Routing > MSE Gateway Routing.

  3. On the MSE Gateway Routes page, click Create Route.

  4. In the Create Route panel, complete the Request Information step and click Next.

    Create an MSE gateway route

    Configure the following parameters:

    Note
    • A route matches only when all conditions in its rule are met.

    • Requests match routes in their display order on the Routes page in the MSE console.

    ParameterDescription
    Route NameEnter a name for the route.
    MSE Cloud Native GatewaySelect a gateway from the drop-down list. To create a new gateway, click + Create an MSE cloud native gateway.
    Associated Domain NameSelect one or more domain names configured on the Domain Names page in the MSE console.
    Match RuleDefine how incoming requests are matched to this route.
    PathThe URL path pattern to match. Select a match type (Prefix Match, Exact Match, or Regex Match) and specify the path value. See Path match types.
    MethodHTTP methods to match. Leave blank to match all methods. Select multiple values to broaden the match scope.
    HeaderHTTP headers to match. Click + Request header to add conditions. More headers mean higher route priority.
    Request Parameter (Query)Query string parameters to match. Click + Request parameters to add conditions. More parameters mean higher route priority.
  5. In the Destination Service step, configure the backend service and click Save.

    ParameterDescription
    Service SourceSelect the type of backend service: EDAS Registration Center, MSE Nacos, or ACK Container. See Supported backend service types.
    MSE Nacos InstanceRequired only when Service Source is set to MSE Nacos. Select an MSE Nacos instance from the drop-down list.
    Destination ServiceClick + Add service and configure NameSpace, Application, Service, Port, and Weight (%).

    Destination service configuration

Apply traffic policies to a route

After you create a route, apply traffic management policies to control throttling, rewriting, headers, CORS, timeouts, and retries.

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Traffic Management > Application Routing > MSE Gateway Routing.

  3. On the MSE Gateway Routes page, find your route and click Policy Settings in the Actions column.

  4. Select a policy tab and click Configure policy.

    Policy settings

PolicyReference
ThrottlingConfigure a throttling policy
RewriteConfigure a rewrite policy
Header SettingsConfigure a header setting policy
CORSConfigure a CORS policy
ExpirationConfigure a timeout policy
RetryConfigure a retry policy

Edit a route

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Traffic Management > Application Routing > MSE Gateway Routing.

  3. On the MSE Gateway Routes page, find the route and click Edit in the Actions column.

Monitor a route

  1. Log on to the EDAS console.

  2. In the left-side navigation pane, choose Traffic Management > Application Routing > MSE Gateway Routing.

  3. On the MSE Gateway Routes page, find the route and click Monitor in the Actions column.

  4. On the monitoring page, view data across three tabs. Use the time range selector in the upper-right corner to filter data on each tab.

    TabData shown
    Global KanbanGlobal monitoring data for the selected gateway.
    Business TOP listTop-ranked workloads.
    Access CenterUser traffic data for the gateway.

    Global Kanban

    Business TOP list

    Access Center

How it works

An MSE cloud-native gateway consists of two components:

  • Control plane: Monitors Ingresses, Ingress classes, and services in an associated ACK cluster, then sends parsed resource configurations to the data plane in real time.

  • Data plane: Implements traffic governance. The data plane processes incoming requests based on governance rules from the control plane and forwards them to the correct backend service.

An MseIngressConfig is a CustomResourceDefinition (CRD) that is provided by MSE Ingress Controller. MSE Ingress Controller creates gateways based on the MseIngressConfigs CRD.