Project: Gloo (Orchestration & Management / API Gateway)
File: route_table.proto.sk.md

title: "route_table.proto" weight: 5 <!-- Code generated by solo-kit. DO NOT EDIT. --> Top-Level Resource The RouteTable is a child routing object for the Gloo Gateway. A RouteTable gets built into the complete routing configuration when it is referenced by a `delegateAction`, either in a parent VirtualService or another RouteTable. Routes specified in a RouteTable must have their paths start with the prefix provided in the parent's matcher. For example, the following configuration: ``` virtualService: mydomain.com match: /a delegate: a-routes routeTable: a-routes match: /1 ``` would not be valid, while ``` virtualService: mydomain.com match: /a delegate: a-routes routeTable: a-routes match: /a/1 ``` would be valid. A complete configuration might look as follows: ```yaml apiVersion: gateway.solo.io/v1 kind: VirtualService metadata: name: 'any' namespace: 'any' spec: virtualHost: domains: 'any.com' routes: matchers: prefix: '/a' # delegate ownership of routes for `any.com/a` delegateAction: ref: name: 'a-routes' namespace: 'a' matchers: prefix: '/b' # delegate ownership of routes for `any.com/b` delegateAction: ref: name: 'b-routes' namespace: 'b' ``` A root-level VirtualService which delegates routing to to the `a-routes` and `b-routes` RouteTables*. Routes with `delegateActions` can only use a `prefix` matcher. ```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata: name: 'a-routes' namespace: 'a' spec: routes: matchers: prefix: '/a/1' routeAction: single: upstream: name: 'foo-upstream' matchers: prefix: '/a/2' routeAction: single: upstream: name: 'bar-upstream' ``` A RouteTable* which defines two routes. ```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata: name: 'b-routes' namespace: 'b' spec: routes: matchers: regex: '/b/3' routeAction: single: upstream: name: 'bar-upstream' matchers: prefix: '/b/c/' delegateAction: ref: name: 'c-routes' namespace: 'c' ``` A RouteTable which both defines a route and delegates to another RouteTable*. ```yaml apiVersion: gateway.solo.io/v1 kind: RouteTable metadata: name: 'c-routes' namespace: 'c' spec: routes: matchers: exact: '/b/c/4' routeAction: single: upstream: name: 'qux-upstream' ``` A RouteTable which is a child of another route table. Would produce the following route config for `mydomain.com`: ``` /a/1 -> foo-upstream /a/2 -> bar-upstream /b/3 -> baz-upstream /b/c/4 -> qux-upstream ``` ```yaml "routes": []gateway.solo.io.Route "weight": .google.protobuf.Int32Value "namespacedStatuses": .core.solo.io.NamespacedStatuses "metadata": .core.solo.io.Metadata ``` | Field | Type | Description | | -- | - | -- | | `routes` | | The list of routes for the route table. | | `weight` | | When a delegated route defines a `RouteTableSelector` that matches multiple route tables, Gloo will inspect this field to determine the order in which the route tables are to be evaluated. This determines the order in which the routes will appear on the final `Proxy` resource. The field is optional; if no value is specified, the weight defaults to 0 (zero). Gloo will process the route tables matched by a selector in ascending order by weight and collect the routes of each route table in the order they are defined. If multiple route tables define the same weight, Gloo will sort the routes which belong to those tables to avoid short-circuiting (e.g. making sure `/foo/bar` comes before `/foo`). In this scenario, Gloo will also alert the user by adding a warning to the status of the parent resource (the one that specifies the `RouteTableSelector`). | | `namespacedStatuses` | | NamespacedStatuses indicates the validation status of this resource. NamespacedStatuses is read-only by clients, and set by gateway during validation. | | `metadata` | | Metadata contains the object metadata for this resource. | <!-- Start of HubSpot Embed Code --> <script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/5130874.js"></script> <!-- End of HubSpot Embed Code -->