Please ensure that you have read the Installation documentation before proceeding.
Alauda Container Platform -> Networking -> RoutesCreate Route button| Field | Description | YAML Path |
|---|---|---|
| Publish to Listener | publish to listener | .spec.parentRefs |
| Hostnames | hostnames | .spec.hostnames |
| Matches | matches | .spec.rules[].matches |
| Filters | filters | .spec.rules[].filters |
| Backend Instance | backend | .spec.rules[].backendRefs |
| Session Affinity | session affinity | .spec.rules[].sessionPersistence |
| Field | Description | YAML Path |
|---|---|---|
| Publish to Listener | publish to listener | .spec.parentRefs |
| Backend Instance | backend | .spec.rules[].backendRefs |
Each route is a CR defined by the GatewayAPI specification. For detailed information about the fields and configuration options for each route type, please refer to the official documentation: - HTTPRoute specification - TCPRoute specification - UDPRoute specification - GRPCRoute specification - TLSRoute specification
The hostnames field in a Route is a string array.
It follows the Hostname Intersection Rules.
sectionName is the listener name.Gateway is in the same namespace. For cross-namespace attachment, please refer to attaching to a gateway created in another namespace.Each route can contain multiple rules. Each rule consists of the following components:
Defines the conditions that must be met for a request to be routed by this rule.
A rule can have multiple matches:
Example: If Match-1 requires path=/api AND header=v1, and Match-2 requires query=test, then a request is routed if it matches either (path=/api AND header=v1) OR (query=test).
| Object | Method | Value Types | Description | Value Requirements |
|---|---|---|---|---|
| Path | ||||
Exact | path (string) | Matches the URL path exactly and with case sensitivity. This means that an exact path match on /abc will only match requests to /abc, NOT /abc/, /Abc, or /abcd. | Must start with /, no consecutive //. | |
PathPrefix | path (string) | Matches based on a URL path prefix split by /. Matching is case-sensitive and done on a path element by element basis. For example, the paths /abc, /abc/, and /abc/def would all match the prefix /abc, but the path /abcd would not. | Must start with /, no consecutive //. | |
RegularExpression | path (string) | Regex Engine: RE2. | for example, /api/v1/.*. | |
| Header | ||||
Exact | name (header key) + value | Exact header value match. | ||
RegularExpression | name (header key) + value | Regex Engine: RE2. | ||
| QueryParam | ||||
Exact | name (param key) + value | Exact query parameter value match. | Parameter value: 1-1024 characters | |
RegularExpression | name (param key) + value | Regex Engine: RE2. | ||
| Method | - | method name | HTTP method match. | GET, HEAD, POST, PUT, DELETE, CONNECT, OPTIONS, TRACE, PATCH |
| Condition Type | Official Documentation |
|---|---|
| Path | HTTPPathMatch |
| Headers | HTTPHeaderMatch |
| QueryParams | HTTPQueryParamMatch |
| Method | HTTPMethod |
Specifies transformations or modifications to apply to requests/responses.
| Type | Method | Value Types | Description | Value Requirements |
|---|---|---|---|---|
| RequestHeaderModifier | Set | name (string) + value (string) | Overwrites request header with given name and value | Max 16 items, value: 1-4096 chars |
Add | name (string) + value (string) | Adds header to request, appending to existing values | Max 16 items, value: 1-4096 chars | |
Remove | []string | Removes specified headers from request (case-insensitive) | Max 16 items | |
| ResponseHeaderModifier | Set | name (string) + value (string) | Overwrites response header with given name and value | Max 16 items, value: 1-4096 chars |
Add | name (string) + value (string) | Adds header to response, appending to existing values | Max 16 items, value: 1-4096 chars | |
Remove | []string | Removes specified headers from response (case-insensitive) | Max 16 items | |
| RequestRedirect | Scheme | string | Scheme for Location header (http/https) | Optional, enum: http|https |
Hostname | PreciseHostname | Hostname for Location header | Optional | |
ReplaceFullPath | string | Replace entire request path | Optional, max 1024 chars | |
ReplacePrefixMatch | string | Replace matched path prefix | Optional, max 1024 chars, only with PathPrefix match | |
Port | PortNumber | Port for Location header | Optional, range: 1-65535 | |
StatusCode | int | HTTP redirect status code | Optional, default: 302, enum: 301|302 | |
| URLRewrite | Hostname | PreciseHostname | Hostname to rewrite in request | Optional |
ReplaceFullPath | string | Replace entire request path | Optional, max 1024 chars | |
ReplacePrefixMatch | string | Replace matched path prefix | Optional, max 1024 chars, only with PathPrefix match | |
| CORS | AllowOrigins | []string | List of allowed origins for CORS requests | Optional |
AllowMethods | []HTTPMethod | List of allowed HTTP methods | Optional, e.g., GET, POST, PUT | |
AllowHeaders | []string | List of allowed headers in CORS requests | Optional | |
ExposeHeaders | []string | List of headers exposed to client in response | Optional | |
MaxAge | Duration | Cache duration for CORS preflight response | Optional | |
AllowCredentials | bool | Whether credentials are allowed in CORS requests | Optional |
Notes:
RequestRedirect and URLRewrite cannot be used together on the same ruleReplacePrefixMatch is only compatible with a PathPrefix HTTPRouteMatch| Filter Type | Official Documentation |
|---|---|
| RequestHeaderModifier | HTTPHeaderFilter |
| ResponseHeaderModifier | HTTPHeaderFilter |
| RequestRedirect | HTTPRequestRedirectFilter |
| URLRewrite | HTTPURLRewriteFilter |
| CORS | HTTPCORSFilter |
| RequestMirror | HTTPRequestMirrorFilter |
| HTTPExternalAuthFilter | HTTPExternalAuthFilter |
Defines the target service(s) where matching requests should be forwarded.
Each service can have a weight field to specify the proportion of traffic to be routed to that service.
HTTPRoute rules support additional configuration fields, such as retry policies, timeouts, and other traffic management parameters.
| Field | Specification |
|---|---|
.spec.rules[].timeouts | HTTPRouteTimeouts |
| Field | Specification |
|---|---|
.spec.rules[].retry | HTTPRouteRetry |
Configures session affinity settings to ensure requests from the same client are routed to the same backend.
| Field | Specification |
|---|---|
.spec.rules[].sessionPersistence | SessionPersistence |