route

Summary

Routes match the URI portion of the incoming request and route traffic to different shared_rules. This allows requests to routes like /api/v1 and /api/v2 to end up at entirely different hosts if desired. The routes objects support matching, prefix rewriting, and redirection of requests.

Example Object

{
  "zone_key": "default",
  "domain_key": "fibonacci",
  "route_key": "fibonacci-route",
  "path": "/",
  "prefix_rewrite": null,
  "redirects": null,
  "shared_rules_key": "",
  "rules": [
    {
      "rule_key": "default",
      "constraints": {
        "light": [
          {
            "constraint_key": "",
            "cluster_key": "fibonacci-service",
            "metadata": null,
            "properties": null,
            "response_data": {},
            "weight": 1
          }
        ],
        "dark": null,
        "tap": null
      }
    }
  ],
  "response_data": {},
  "cohort_seed": null,
  "retry_policy": {
    "num_retries": 3
  }
}

Features

See the routing documentation for an explanation of all of the routing features and how to set them.

Envoy Reference

Fields

route_key

A unique key to identify this route configuration in the Fabric API.

domain_key

String domain key to specify which domain object this route should attach to.

zone_key

The zone in which this object will live. It will only be able to be referenced by objects or sent to Sidecars that live in the same zone.

path

DEPRECATION: This field has been deprecated and will be removed in the next major version release. Use route_match instead.

Explicit path string to match on. E.g. "/services/catalog/" or "/apps/ui/".

route_match

Route match to match against incoming requests.

prefix_rewrite

When a match is found using the values configured in route_match, the value of the :path header on the request will be replaced with this value for forwarding.

redirects

This field has no effect. To set redirects on thee virtual host level, see the domain object.

shared_rules_key

Indicates the key of the shared_rules object to use for specifying a default cluster to forward to.

This field may be omitted if rules are defined directly.

rules

A list of rules to specify various more complex route matching and forwarding specifications.

response_data

A collection of annotations that should be applied to responses when handling a request. Configuration

cohort_seed

This field has no effect.

retry_policy

A retry_policy that controls how this route will handle automatic retries to upstream clusters and govern timeouts.

high_priority

Defaults to false, which indicates this is normal traffic. If set to true, routes are considered high priority which allows different handling of the request.

filter_metadata

A map from from string to metadata that can be used to provide virtual host-specific configurations for filters. See the per route filter configuration guide for info on setting this up.

checksum

An API calculated checksum. Can be used to verify that the API contains the expected object before performing a write.

Last updated

Was this helpful?