HTTP scoped routing configuration

config.route.v3.ScopedRouteConfiguration

[config.route.v3.ScopedRouteConfiguration proto]

Specifies a routing scope, which associates a Key to a config.route.v3.RouteConfiguration (identified by its resource name).

The HTTP connection manager builds up a table consisting of these Key to RouteConfiguration mappings, and looks up the RouteConfiguration to use per request according to the algorithm specified in the scope_key_builder assigned to the HttpConnectionManager.

For example, with the following configurations (in YAML):

HttpConnectionManager config:

  1. ...
  2. scoped_routes:
  3. name: foo-scoped-routes
  4. scope_key_builder:
  5. fragments:
  6. - header_value_extractor:
  7. name: X-Route-Selector
  8. element_separator: ,
  9. element:
  10. separator: =
  11. key: vip

ScopedRouteConfiguration resources (specified statically via scoped_route_configurations_list or obtained dynamically via SRDS):

  1. (1)
  2. name: route-scope1
  3. route_configuration_name: route-config1
  4. key:
  5. fragments:
  6. - string_key: 172.10.10.20
  7. (2)
  8. name: route-scope2
  9. route_configuration_name: route-config2
  10. key:
  11. fragments:
  12. - string_key: 172.20.20.30

A request from a client such as:

  1. GET / HTTP/1.1
  2. Host: foo.com
  3. X-Route-Selector: vip=172.10.10.20

would result in the routing table defined by the route-config1 RouteConfiguration being assigned to the HTTP request/stream.

  1. {
  2. "name": "...",
  3. "route_configuration_name": "...",
  4. "key": "{...}"
  5. }

name

(string, REQUIRED) The name assigned to the routing scope.

route_configuration_name

(string, REQUIRED) The resource name to use for a service.discovery.v3.DiscoveryRequest to an RDS server to fetch the config.route.v3.RouteConfiguration associated with this scope.

key

(config.route.v3.ScopedRouteConfiguration.Key, REQUIRED) The key to match against.

config.route.v3.ScopedRouteConfiguration.Key

[config.route.v3.ScopedRouteConfiguration.Key proto]

Specifies a key which is matched against the output of the scope_key_builder specified in the HttpConnectionManager. The matching is done per HTTP request and is dependent on the order of the fragments contained in the Key.

  1. {
  2. "fragments": []
  3. }

fragments

(config.route.v3.ScopedRouteConfiguration.Key.Fragment, REQUIRED) The ordered set of fragments to match against. The order must match the fragments in the corresponding scope_key_builder.

config.route.v3.ScopedRouteConfiguration.Key.Fragment

[config.route.v3.ScopedRouteConfiguration.Key.Fragment proto]

  1. {
  2. "string_key": "..."
  3. }

string_key

(string, REQUIRED) A string to match against.