apiVersion:gateway.solo.io/v1kind:VirtualServicemetadata: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-routesRouteTables.
Routes with delegateActions can only use a prefix matcher.
apiVersion:gateway.solo.io/v1kind:RouteTablemetadata:name:'a-routes'namespace:'a'spec:routes:- matchers:# the path matchers in this RouteTable must begin with the prefix `/a/`- 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.
apiVersion:gateway.solo.io/v1kind:RouteTablemetadata:name:'b-routes'namespace:'b'spec:routes:- matchers:# the path matchers in this RouteTable must begin with the prefix `/b/`- regex:'/b/3'routeAction:single:upstream:name:'bar-upstream'- matchers:- prefix:'/b/c/'# routes in the RouteTable can perform any action, including a delegateActiondelegateAction:ref:name:'c-routes'namespace:'c'
A RouteTable which both defines a route and delegates to another RouteTable.
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).