Skip to content

document all the route annotations and PR11984 #3301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions architecture/core_concepts/routes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ addresses; because of the NAT configuration, the originating IP address
`*hostNetwork: true*`, all external clients will be routed to a single pod.
====

[[env-variables]]
*Configuration Parameters*

For all the items outlined in this section, you can set environment
Expand All @@ -209,8 +210,8 @@ variables on the *deployment config* for the router to alter its configuration.
|`*ROUTER_ENABLE_COMPRESSION*`| false | If `true`, compress responses when possible.
|`*ROUTER_LOG_LEVEL*` | warning | The log level to send to the syslog server.
|`*ROUTER_OVERRIDE_HOSTNAME*`| | If set, override the spec.host value for a route with the template in ROUTER_SUBDOMAIN.
|`*ROUTER_SERVICE_HTTPS_PORT*` | 443 | Port to listen for https requests.
|`*ROUTER_SERVICE_HTTP_PORT*` | 80 | Port to listen for http requests.
|`*ROUTER_SERVICE_HTTPS_PORT*` | 443 | Port to listen for HTTPS requests.
|`*ROUTER_SERVICE_HTTP_PORT*` | 80 | Port to listen for HTTP requests.
|`*ROUTER_SERVICE_NAME*` | public | The name that the router will identify itself with in route statuses.
|`*ROUTER_SERVICE_NAMESPACE*` | | The namespace the router will identify itself with in route statuses. Required if `ROUTER_SERVICE_NAME` is used.
|`*ROUTER_SERVICE_NO_SNI_PORT*` | 10443 | Internal port for some front-end to back-end communication (see note below).
Expand All @@ -219,6 +220,7 @@ variables on the *deployment config* for the router to alter its configuration.
|`*ROUTER_SUBDOMAIN*`| | The template that should be used to generate the hostname for a route without spec.host (e.g. `${name}-${namespace}.myapps.mycompany.com`).
|`*ROUTER_SYSLOG_ADDRESS*` | | Address to send log messages. Disabled if empty.
|`*ROUTER_TCP_BALANCE_SCHEME*` | source | Load-balancing strategy for multiple endpoints for pass-through routes. Available options are `source`, `roundrobin`, or `leastconn`.
|`*ROUTER_LOAD_BALANCE_ALGORITHM*` | leastconn | Load-balanceing strategy routes with multiple endpoints. Available options are `source`, `roundrobin`, or `leastconn`.
|`*ROUTE_FIELDS*` | | A field selector to apply to routes to watch, empty means all.
|`*ROUTE_LABELS*` | | A label selector to apply to the routes to watch, empty means all.
|`*STATS_PASSWORD*` | | The password needed to access router stats (if the router implementation supports it).
Expand Down Expand Up @@ -648,7 +650,7 @@ spec:
----
<1> The name of the object, which is limited to 63 characters.
<2> The `*termination*` field is `edge` for edge termination.
<3> The insecure policy to redirect requests sent on an insecure scheme `HTTP` to a secure scheme `HTTPS`.
<3> The insecure policy to redirect requests sent on an i/nsecure scheme `HTTP` to a secure scheme `HTTPS`.
====

[[passthrough-termination]]
Expand Down Expand Up @@ -817,11 +819,32 @@ resolution order (oldest route wins).
====


[[route-specific-timeouts]]
== Route-specific Timeouts
[[route-specific-annotations]]
== Route-specific Annotations

By default, a server-side timeout is set across all routes. It is possible to
change that timeout using an annotation in the route configuration.
Using environment variables as defined in xref:env-variables[Configuration Parameters],
a router can set the default options for all the routes it exposes. An individual route can
override some of these defaults by providing specific configuration in its annotations.


*Route Annotations*

For all the items outlined in this section, you can set annotations on the
*route definition* for the route to alter its configuration

.Route Annotations
[cols="3*", options="header"]
|===
|Variable | Description | Environment Variable used as default
|`*haproxy.router.openshift.io/balance*`| Sets the load-balancing algorithm. Available options are `source`, `roundrobin`, or `leastconn`. | `*ROUTER_TCP_BALANCE_SCHEME*` for passthrough routes overwise `*ROUTER_LOAD_BALANCE_ALGORITHM*`.
|`*haproxy.router.openshift.io/disable_cookies*`| Disables the use of cookies to track related connections. If set to `*true*` the balance algorithm is used to choose which back-end serves connections for each incoming HTTP request. |
|`*haproxy.router.openshift.io/rate-limit-connections*`| Setting to `*true*` enables rate limiting functionality. |
|`*haproxy.router.openshift.io/rate-limit-connections.concurrent-tcp*`| Limits the number of concurrent TCP connections shared by an IP address. |
|`*haproxy.router.openshift.io/rate-limit-connections.rate-http*`| Limits the rate at which an IP address can make HTTP requests. |
|`*haproxy.router.openshift.io/rate-limit-connections.rate-tcp*`| Limits the rate at which an IP address can make TCP connections. |
|`*haproxy.router.openshift.io/timeout*` | Sets a server-side timeout. | `*ROUTER_DEFAULT_SERVER_TIMEOUT*`
|`*router.openshift.io/haproxy.health.check.interval*`| Sets the interval for the back-end health checks. | `*ROUTER_BACKEND_CHECK_INTERVAL*`
|===


.A Route Setting Custom Timeout
Expand Down