pub struct RouteSpec {
pub alternate_backends: Option<Vec<RouteTargetReference>>,
pub host: String,
pub path: Option<String>,
pub port: Option<RoutePort>,
pub tls: Option<TLSConfig>,
pub to: RouteTargetReference,
pub wildcard_policy: Option<String>,
}
Expand description
RouteSpec describes the hostname or path the route exposes, any security information, and one to four backends (services) the route points to. Requests are distributed among the backends depending on the weights assigned to each backend. When using roundrobin scheduling the portion of requests that go to each backend is the backend weight divided by the sum of all of the backend weights. When the backend has more than one endpoint the requests that end up on the backend are roundrobin distributed among the endpoints. Weights are between 0 and 256 with default 1. Weight 0 causes no requests to the backend. If all weights are zero the route will be considered to have no backends and return a standard 503 response.
The tls
field is optional and allows specific certificates or behavior for the route. Routers typically configure a default certificate on a wildcard domain to terminate routes without explicit certificates, but custom hostnames usually must choose passthrough (send traffic directly to the backend via the TLS Server-Name- Indication field) or provide a certificate.
Fields§
§alternate_backends: Option<Vec<RouteTargetReference>>
alternateBackends allows up to 3 additional backends to be assigned to the route. Only the Service kind is allowed, and it will be defaulted to Service. Use the weight field in RouteTargetReference object to specify relative preference.
host: String
host is an alias/DNS that points to the service. Optional. If not specified a route name will typically be automatically chosen. Must follow DNS952 subdomain conventions.
path: Option<String>
Path that the router watches for, to route traffic for to the service. Optional
port: Option<RoutePort>
If specified, the port to be used by the router. Most routers will use all endpoints exposed by the service by default - set this value to instruct routers which port to use.
tls: Option<TLSConfig>
The tls field provides the ability to configure certificates and termination for the route.
to: RouteTargetReference
to is an object the route should use as the primary backend. Only the Service kind is allowed, and it will be defaulted to Service. If the weight field (0-256 default 1) is set to zero, no traffic will be sent to this backend.
wildcard_policy: Option<String>
Wildcard policy if any for the route. Currently only ‘Subdomain’ or ‘None’ is allowed.