Skip to content

Commit 38b0c27

Browse files
Merge pull request #31152 from sagidlow/BZ-1783799
BZ-1783799: Added path based route doc
2 parents 4295cab + 3df0d30 commit 38b0c27

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

modules/nw-path-based-routes.adoc

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Module filename: nw-path-based-routes.adoc
2+
// Module included in the following assemblies:
3+
// * networking/routes/route-configuration.adoc
4+
5+
[id="nw-path-based-routes_{context}"]
6+
= Path-based routes
7+
8+
Path-based routes specify a path component that can be compared against a URL, which requires that the traffic for the route be HTTP based. Thus, multiple routes can be served using the same host name, each with a different path. Routers should match routes based on the most specific path to the least. However, this depends on the router implementation.
9+
10+
The following table shows example routes and their accessibility:
11+
12+
.Route availability
13+
[cols="3*", options="header"]
14+
|===
15+
|Route | When Compared to | Accessible
16+
.2+|_www.example.com/test_ |_www.example.com/test_|Yes
17+
|_www.example.com_|No
18+
.2+|_www.example.com/test_ and _www.example.com_ | _www.example.com/test_|Yes
19+
|_www.example.com_|Yes
20+
.2+|_www.example.com_|_www.example.com/text_|Yes (Matched by the host, not the route)
21+
|_www.example.com_|Yes
22+
|===
23+
24+
.An unsecured route with a path
25+
26+
[source,yaml]
27+
----
28+
apiVersion: v1
29+
kind: Route
30+
metadata:
31+
name: route-unsecured
32+
spec:
33+
host: www.example.com
34+
path: "/test" <1>
35+
to:
36+
kind: Service
37+
name: service-name
38+
----
39+
<1> The path is the only added attribute for a path-based route.
40+
41+
[NOTE]
42+
====
43+
Path-based routing is not available when using passthrough TLS, as the router does not terminate TLS in that case and cannot read the contents of the request.
44+
====

networking/routes/route-configuration.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ include::modules/nw-throughput-troubleshoot.adoc[leveloffset=+1]
2020
include::modules/nw-using-cookies-keep-route-statefulness.adoc[leveloffset=+1]
2121
include::modules/nw-annotating-a-route-with-a-cookie-name.adoc[leveloffset=+2]
2222

23+
include::modules/nw-path-based-routes.adoc[leveloffset=+1]
24+
2325
include::modules/nw-route-specific-annotations.adoc[leveloffset=+1]
2426

2527
include::modules/nw-route-admission-policy.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)