Skip to content

Commit 0f80529

Browse files
authored
Merge pull request #67912 from duritong/patch-3
resource presentation not as a List
2 parents 6406ded + 68131d1 commit 0f80529

File tree

4 files changed

+69
-91
lines changed

4 files changed

+69
-91
lines changed

modules/nw-ingress-sharding-default.adoc

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,20 @@ $ oc edit ingresscontroller -n openshift-ingress-operator default
3434
+
3535
[source,yaml]
3636
----
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:
37+
apiVersion: operator.openshift.io/v1
38+
kind: IngressController
39+
metadata:
40+
name: default
41+
namespace: openshift-ingress-operator
42+
spec:
4543
namespaceSelector:
4644
matchExpressions:
47-
- key: type
48-
operator: NotIn
49-
values:
50-
- finance
51-
- ops
52-
- dev
45+
- key: type
46+
operator: NotIn
47+
values:
48+
- finance
49+
- ops
50+
- dev
5351
----
5452

5553
The default Ingress Controller will no longer serve the namespaces labeled `name:finance`, `name:ops`, and `name:dev`.

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

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,20 @@ to another.
3131
.Example output
3232
[source,yaml]
3333
----
34-
apiVersion: v1
35-
items:
36-
- apiVersion: operator.openshift.io/v1
37-
kind: IngressController
38-
metadata:
39-
name: sharded
40-
namespace: openshift-ingress-operator
41-
spec:
42-
domain: <apps-sharded.basedomain.example.net> <1>
43-
nodePlacement:
44-
nodeSelector:
45-
matchLabels:
46-
node-role.kubernetes.io/worker: ""
47-
namespaceSelector:
48-
matchLabels:
49-
type: sharded
50-
status: {}
51-
kind: List
34+
apiVersion: operator.openshift.io/v1
35+
kind: IngressController
5236
metadata:
53-
resourceVersion: ""
54-
selfLink: ""
37+
name: sharded
38+
namespace: openshift-ingress-operator
39+
spec:
40+
domain: <apps-sharded.basedomain.example.net> <1>
41+
nodePlacement:
42+
nodeSelector:
43+
matchLabels:
44+
node-role.kubernetes.io/worker: ""
45+
namespaceSelector:
46+
matchLabels:
47+
type: sharded
5548
----
5649
<1> Specify a domain to be used by the Ingress Controller. This domain must be different from the default Ingress Controller domain.
5750

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

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,20 @@ to another.
2626
[source,terminal]
2727
----
2828
# cat router-internal.yaml
29-
apiVersion: v1
30-
items:
31-
- apiVersion: operator.openshift.io/v1
32-
kind: IngressController
33-
metadata:
34-
name: sharded
35-
namespace: openshift-ingress-operator
36-
spec:
37-
domain: <apps-sharded.basedomain.example.net> <1>
38-
nodePlacement:
39-
nodeSelector:
40-
matchLabels:
41-
node-role.kubernetes.io/worker: ""
42-
routeSelector:
43-
matchLabels:
44-
type: sharded
45-
status: {}
46-
kind: List
29+
apiVersion: operator.openshift.io/v1
30+
kind: IngressController
4731
metadata:
48-
resourceVersion: ""
49-
selfLink: ""
32+
name: sharded
33+
namespace: openshift-ingress-operator
34+
spec:
35+
domain: <apps-sharded.basedomain.example.net> <1>
36+
nodePlacement:
37+
nodeSelector:
38+
matchLabels:
39+
node-role.kubernetes.io/worker: ""
40+
routeSelector:
41+
matchLabels:
42+
type: sharded
5043
----
5144
<1> Specify a domain to be used by the Ingress Controller. This domain must be different from the default Ingress Controller domain.
5245

modules/nw-ingress-sharding.adoc

Lines changed: 31 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -37,37 +37,33 @@ An Ingress Controller `finops-router` is configured with the label selector `spe
3737
.Example YAML definition for `finops-router`
3838
[source,yaml]
3939
----
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
40+
apiVersion: operator.openshift.io/v1
41+
kind: IngressController
42+
metadata:
43+
name: finops-router
44+
namespace: openshift-ingress-operator
45+
spec:
46+
namespaceSelector:
47+
matchLabels:
48+
name:
49+
- finance
50+
- ops
5351
----
5452

5553
A second Ingress Controller `dev-router` is configured with the label selector `spec.namespaceSelector.matchLabels.name` set to `dev`:
5654

5755
.Example YAML definition for `dev-router`
5856
[source,yaml]
5957
----
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
58+
apiVersion: operator.openshift.io/v1
59+
kind: IngressController
60+
metadata:
61+
name: dev-router
62+
namespace: openshift-ingress-operator
63+
spec:
64+
namespaceSelector:
65+
matchLabels:
66+
name: dev
7167
----
7268

7369
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.
@@ -86,19 +82,17 @@ In addition to `finops-router` and `dev-router` in the example above, you also h
8682
.Example YAML definition for `devops-router`
8783
[source,yaml]
8884
----
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
85+
apiVersion: operator.openshift.io/v1
86+
kind: IngressController
87+
metadata:
88+
name: devops-router
89+
namespace: openshift-ingress-operator
90+
spec:
91+
namespaceSelector:
92+
matchLabels:
93+
name:
94+
- dev
95+
- ops
10296
----
10397
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.
10498

0 commit comments

Comments
 (0)