Skip to content

Commit e9f5aaa

Browse files
committed
OSDOCS-3417: separate out sharding docs
1 parent d9b46ea commit e9f5aaa

10 files changed

+207
-8
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,8 @@ Topics:
10741074
- Name: Understanding the Ingress Operator
10751075
File: ingress-operator
10761076
Distros: openshift-enterprise,openshift-origin
1077+
- Name: Ingress sharding
1078+
File: ingress-sharding
10771079
- Name: Understanding the Ingress Node Firewall Operator
10781080
File: ingress-node-firewall-operator
10791081
Distros: openshift-enterprise,openshift-origin
50.3 KB
Loading

images/nw-sharding-route-labels.png

52.6 KB
Loading
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// Module include in the following assemblies:
2+
//
3+
// * ingress-operator.adoc
4+
// * networking/ingress-sharding.adoc
5+
6+
:_content-type: PROCEDURE
7+
[id="nw-ingress-sharding-default_{context}"]
8+
= Sharding the default Ingress Controller
9+
10+
After creating a new Ingress shard, there might be routes that are admitted to your new Ingress shard that are also admitted by the default Ingress Controller. This is because the default Ingress Controller has no selectors and admits all routes by default.
11+
12+
You can restrict an Ingress Controller from servicing routes with specific labels using either namespace selectors or route selectors. The following procedure restricts the default Ingress Controller from servicing your newly sharded `finance`, `ops`, and `dev`, routes using a namespace selector. This adds further isolation to Ingress shards.
13+
14+
[IMPORTANT]
15+
====
16+
You must keep all of {product-title}'s administration routes on the same Ingress Controller. Therefore, avoid adding additional selectors to the default Ingress Controller that exclude these essential routes.
17+
====
18+
19+
.Prerequisites
20+
21+
* You installed the OpenShift CLI (`oc`).
22+
* You are logged in as a project administrator.
23+
24+
.Procedure
25+
26+
. Modify the default Ingress Controller by running the following command:
27+
+
28+
[source,terminal]
29+
----
30+
$ oc edit ingresscontroller -n openshift-ingress-operator default
31+
----
32+
33+
. Edit the Ingress Controller to contain a `namespaceSelector` that excludes the routes with any of the `finance`, `ops`, and `dev` labels:
34+
+
35+
[source,yaml]
36+
----
37+
apiVersion: v1
38+
items:
39+
- apiVersion: operator.openshift.io/v1
40+
kind: IngressController
41+
metadata:
42+
name: default
43+
namespace: openshift-ingress-operator
44+
spec:
45+
namespaceSelector:
46+
matchExpressions:
47+
- key: type
48+
operator: NotIn
49+
values:
50+
- finance
51+
- ops
52+
- dev
53+
----
54+
55+
The default Ingress Controller will no longer serve the namespaces labeled `name:finance`, `name:ops`, and `name:dev`.

modules/nw-ingress-sharding-dns.adoc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Module included in the folllowing assemblies:
2+
//
3+
// * networking/ingress-sharding.adoc
4+
5+
:_content-type: CONCEPT
6+
[id="nw-ingress-sharding-dns_{context}"]
7+
= Ingress sharding and DNS
8+
9+
The cluster administrator is responsible for making a separate DNS entry for each router in a project. A router will not forward unknown routes to another router.
10+
11+
Consider the following example:
12+
13+
* Router A lives on host 192.168.0.5 and has routes with `*.foo.com`.
14+
* Router B lives on host 192.168.1.9 and has routes with `*.example.com`.
15+
16+
Separate DNS entries must resolve `\*.foo.com` to the node hosting Router A and `*.example.com` to the node hosting Router B:
17+
18+
* `*.foo.com A IN 192.168.0.5`
19+
* `*.example.com A IN 192.168.1.9`

modules/nw-ingress-sharding-namespace-labels.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ Ingress Controller sharding by using namespace labels means that the Ingress
1111
Controller serves any route in any namespace that is selected by the namespace
1212
selector.
1313

14+
.Ingress sharding using namespace labels
15+
image::nw-sharding-namespace-labels.png[A diagram showing multiple Ingress Controllers with different namespace selectors serving routes that belong to the namespace containing a label that matches a given namespace selector]
16+
1417
Ingress Controller sharding is useful when balancing incoming traffic load among
1518
a set of Ingress Controllers and when isolating traffic to a specific Ingress
1619
Controller. For example, company A goes to one Ingress Controller and company B
1720
to another.
1821

19-
[WARNING]
20-
====
21-
If you deploy the Keepalived Ingress VIP, do not deploy a non-default Ingress Controller with value `HostNetwork` for the `endpointPublishingStrategy` parameter. Doing so might cause issues. Use value `NodePort` instead of `HostNetwork` for `endpointPublishingStrategy`.
22-
====
23-
2422
.Procedure
2523

2624
. Edit the `router-internal.yaml` file:

modules/nw-ingress-sharding-route-labels.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ Ingress Controller sharding by using route labels means that the Ingress
1111
Controller serves any route in any namespace that is selected by the route
1212
selector.
1313

14+
.Ingress sharding using route labels
15+
image::nw-sharding-route-labels.png[A diagram showing multiple Ingress Controllers with different route selectors serving any route containing a label that matches a given route selector regardless of the namespace a route belongs to]
16+
1417
Ingress Controller sharding is useful when balancing incoming traffic load among
1518
a set of Ingress Controllers and when isolating traffic to a specific Ingress
1619
Controller. For example, company A goes to one Ingress Controller and company B

modules/nw-ingress-sharding.adoc

Lines changed: 91 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,105 @@
11
// Module included in the following assemblies:
22
//
3-
// * configuring_ingress_cluster_traffic/configuring-ingress-cluster-traffic-ingress-controller.adoc
43
// * ingress-operator.adoc
4+
// * networking/ingress-sharding.adoc
55

6+
:_content-type: CONCEPT
67
[id="nw-ingress-sharding_{context}"]
78
= Ingress Controller sharding
89

9-
As the primary mechanism for traffic to enter the cluster, the demands on the Ingress Controller, or router, can be significant. As a cluster administrator, you can shard the routes to:
10+
You can use Ingress sharding, also known as router sharding, to distribute a set of routes across multiple routers by adding labels to routes, namespaces, or both. The Ingress Controller uses a corresponding set of selectors to admit only the routes that have a specified label. Each Ingress shard comprises the routes that are filtered using a given selection expression.
11+
12+
As the primary mechanism for traffic to enter the cluster, the demands on the Ingress Controller can be significant. As a cluster administrator, you can shard the routes to:
1013

1114
* Balance Ingress Controllers, or routers, with several routes to speed up responses to changes.
1215
* Allocate certain routes to have different reliability guarantees than other routes.
1316
* Allow certain Ingress Controllers to have different policies defined.
1417
* Allow only specific routes to use additional features.
1518
* Expose different routes on different addresses so that internal and external users can see different routes, for example.
19+
* Transfer traffic from one version of an application to another during a blue green deployment.
20+
21+
When Ingress Controllers are sharded, a given route is admitted to zero or more Ingress Controllers in the group. A route's status describes whether an Ingress Controller has admitted it or not. An Ingress Controller will only admit a route if it is unique to its shard.
22+
23+
An Ingress Controller can use three sharding methods:
24+
25+
* Adding only a namespace selector to the Ingress Controller, so that all routes in a namespace with labels that match the namespace selector are in the Ingress shard.
26+
27+
* Adding only a route selector to the Ingress Controller, so that all routes with labels that match the route selector are in the Ingress shard.
28+
29+
* Adding both a namespace selector and route selector to the Ingress Controller, so that routes with labels that match the route selector in a namespace with labels that match the namespace selector are in the Ingress shard.
30+
31+
With sharding, you can distribute subsets of routes over multiple Ingress Controllers. These subsets can be non-overlapping, also called _traditional_ sharding, or overlapping, otherwise known as _overlapped_ sharding.
32+
33+
== Traditional sharding example
34+
35+
An Ingress Controller `finops-router` is configured with the label selector `spec.namespaceSelector.matchLabels.name` set to `finance` and `ops`:
36+
37+
.Example YAML definition for `finops-router`
38+
[source,yaml]
39+
----
40+
apiVersion: v1
41+
items:
42+
- apiVersion: operator.openshift.io/v1
43+
kind: IngressController
44+
metadata:
45+
name: finops-router
46+
namespace: openshift-ingress-operator
47+
spec:
48+
namespaceSelector:
49+
matchLabels:
50+
name:
51+
- finance
52+
- ops
53+
----
54+
55+
A second Ingress Controller `dev-router` is configured with the label selector `spec.namespaceSelector.matchLabels.name` set to `dev`:
56+
57+
.Example YAML definition for `dev-router`
58+
[source,yaml]
59+
----
60+
apiVersion: v1
61+
items:
62+
- apiVersion: operator.openshift.io/v1
63+
kind: IngressController
64+
metadata:
65+
name: dev-router
66+
namespace: openshift-ingress-operator
67+
spec:
68+
namespaceSelector:
69+
matchLabels:
70+
name: dev
71+
----
72+
73+
If all application routes are in separate namespaces, each labeled with `name:finance`, `name:ops`, and `name:dev` respectively, this configuration effectively distributes your routes between the two Ingress Controllers. {product-title} routes for console, authentication, and other purposes should not be handled.
74+
75+
In the above scenario, sharding becomes a special case of partitioning, with no overlapping subsets. Routes are divided between router shards.
76+
77+
[WARNING]
78+
====
79+
The `default` Ingress Controller continues to serve all routes unless the `namespaceSelector` or `routeSelector` fields contain routes that are meant for exclusion. See this link:https://access.redhat.com/solutions/5097511[Red Hat Knowledgebase solution] and the section "Sharding the default Ingress Controller" for more information on how to exclude routes from the default Ingress Controller.
80+
====
81+
82+
== Overlapped sharding example
83+
84+
In addition to `finops-router` and `dev-router` in the example above, you also have `devops-router`, which is configured with the label selector `spec.namespaceSelector.matchLabels.name` set to `dev` and `ops`:
85+
86+
.Example YAML definition for `devops-router`
87+
[source,yaml]
88+
----
89+
apiVersion: v1
90+
items:
91+
- apiVersion: operator.openshift.io/v1
92+
kind: IngressController
93+
metadata:
94+
name: devops-router
95+
namespace: openshift-ingress-operator
96+
spec:
97+
namespaceSelector:
98+
matchLabels:
99+
name:
100+
- dev
101+
- ops
102+
----
103+
The routes in the namespaces labeled `name:dev` and `name:ops` are now serviced by two different Ingress Controllers. With this configuration, you have overlapping subsets of routes.
16104

17-
Ingress Controller can use either route labels or namespace labels as a sharding method.
105+
With overlapping subsets of routes you can create more complex routing rules. For example, you can divert higher priority traffic to the dedicated `finops-router` while sending lower priority traffic to `devops-router`.

networking/ingress-operator.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ include::modules/nw-ingress-setting-thread-count.adoc[leveloffset=+2]
6969

7070
include::modules/nw-ingress-sharding.adoc[leveloffset=+2]
7171

72+
include::modules/nw-ingress-sharding-default.adoc[leveloffset=+3]
73+
7274
include::modules/nw-ingress-sharding-route-labels.adoc[leveloffset=+3]
7375

7476
include::modules/nw-ingress-sharding-namespace-labels.adoc[leveloffset=+3]

networking/ingress-sharding.adoc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
:_content-type: ASSEMBLY
2+
[id="ingress-sharding"]
3+
= Ingress sharding in {product-title}
4+
include::_attributes/common-attributes.adoc[]
5+
:context: ingress-sharding
6+
7+
toc::[]
8+
9+
In {product-title}, an Ingress Controller can serve all routes, or it can serve a subset of routes. By default, the Ingress Controller serves any route created in any namespace in the cluster. You can add additional Ingress Controllers to your cluster to optimize routing by creating _shards_, which are subsets of routes based on selected characteristics. To mark a route as a member of a shard, use labels in the route or namespace `metadata` field. The Ingress Controller uses _selectors_, also known as a _selection expression_, to select a subset of routes from the entire pool of routes to serve.
10+
11+
Ingress sharding is useful in cases where you want to load balance incoming traffic across multiple Ingress Controllers, when you want to isolate traffic to be routed to a specific Ingress Controller, or for a variety of other reasons described in the next section.
12+
13+
By default, each route uses the default domain of the cluster. However, routes can be configured to use the domain of the router instead. For more information, see xref:../networking/ingress-sharding.adoc#nw-ingress-sharding-route-configuration_ingress-sharding[Creating a route for Ingress Controller Sharding].
14+
15+
include::modules/nw-ingress-sharding.adoc[leveloffset=+1]
16+
17+
include::modules/nw-ingress-sharding-default.adoc[leveloffset=+2]
18+
19+
include::modules/nw-ingress-sharding-dns.adoc[leveloffset=+2]
20+
21+
include::modules/nw-ingress-sharding-route-labels.adoc[leveloffset=+2]
22+
23+
include::modules/nw-ingress-sharding-namespace-labels.adoc[leveloffset=+2]
24+
25+
include::modules/nw-ingress-sharding-route-configuration.adoc[leveloffset=+1]
26+
27+
[discrete]
28+
[role="_additional-resources"]
29+
[id="additional-resources_ingress-sharding"]
30+
== Additional Resources
31+
32+
* xref:../scalability_and_performance/routing-optimization.adoc#baseline-router-performance_routing-optimization[Baseline Ingress Controller (router) performance]

0 commit comments

Comments
 (0)