Skip to content

Commit 4b05d3b

Browse files
authored
Merge pull request #37131 from luksa/OSSMDOC-418
OSSMDOC-418 Fix OSSM federation examples
2 parents 09afe91 + a18ae63 commit 4b05d3b

6 files changed

+83
-66
lines changed

modules/ossm-federation-config-export.adoc

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ spec:
3939
alias:
4040
namespace: bookinfo
4141
name: ratings
42-
# export any service in red-mesh-bookinfo namespace with label export-service=true
42+
# export any service in red-mesh-bookinfo namespace with label export-service=true
4343
- type: LabelSelector
4444
labelSelector:
4545
namespace: red-mesh-bookinfo
46-
Selector:
46+
selector:
4747
matchLabels:
48-
export-service: “true”
49-
alias: # exported as if they were in the bookinfo namespace
50-
namespace: bookinfo
48+
export-service: "true"
49+
aliases: # export all matching services as if they were in the bookinfo namespace
50+
- namespace: "*"
51+
name: "*"
52+
alias:
53+
namespace: bookinfo
5154
----
5255

5356
.ExportServiceSet parameters
@@ -67,23 +70,23 @@ spec:
6770

6871
|spec:
6972
exportRules:
70-
-type:
73+
- type:
7174
|Type of rule that will govern the export for this service. The first matching rule found for the service will be used for the export.
7275
|`NameSelector`, `LabelSelector`
7376

7477
|spec:
7578
exportRules:
76-
-type: nameSelector
77-
NameSelector:
79+
- type: NameSelector
80+
nameSelector:
7881
namespace:
7982
name:
80-
|To create a `NameSelector` rule, specify the `namespace` of the service and the `name` of the service as defined in the `Deployment` resource.
83+
|To create a `NameSelector` rule, specify the `namespace` of the service and the `name` of the service as defined in the `Service` resource.
8184
|
8285

8386
|spec:
8487
exportRules:
85-
-type: NameSelector
86-
NameSelector:
88+
- type: NameSelector
89+
nameSelector:
8790
alias:
8891
namespace:
8992
name:
@@ -92,27 +95,30 @@ spec:
9295

9396
|spec:
9497
exportRules:
95-
-type: LabelSelector
96-
LabelSelector:
98+
- type: LabelSelector
99+
labelSelector:
97100
namespace: <exportingMesh>
98-
Selector:
101+
selector:
99102
matchLabels:
100-
<label>: "true"
101-
|To create a `LabelSelector` rule, specify the `namespace` of the service and specify the `label` defined in the `Deployment` resource. In the example above, the label is `export-service`.
103+
<labelKey>: <labelValue>
104+
|To create a `LabelSelector` rule, specify the `namespace` of the service and specify the `label` defined in the `Service` resource. In the example above, the label is `export-service`.
102105
|
103106

104107
|spec:
105108
exportRules:
106-
-type: LabelSelector
107-
LabelSelector:
109+
- type: LabelSelector
110+
labelSelector:
108111
namespace: <exportingMesh>
109-
Selector:
112+
selector:
110113
matchLabels:
111-
<label>: "true"
112-
alias:
113-
namespace:
114+
<labelKey>: <labelValue>
115+
aliases:
116+
- namespace:
114117
name:
115-
|To create a `LabelSelector` rule that uses an alias for the service, after specifying the `namespace` and `label`, then specify the alias to be used for `name` or `namespace` of the service. In the example above, the alias is `bookinfo`.
118+
alias:
119+
namespace:
120+
name:
121+
|To create a `LabelSelector` rule that uses aliases for the services, after specifying the `selector`, specify the aliases to be used for `name` or `namespace` of the service. In the example above, the namespace alias is `bookinfo` for all matching services.
116122
|
117123
|===
118124

@@ -130,7 +136,7 @@ spec:
130136
exportRules:
131137
- type: NameSelector
132138
nameSelector:
133-
namespace: *
139+
namespace: "*"
134140
name: ratings
135141
----
136142

@@ -147,5 +153,5 @@ spec:
147153
- type: NameSelector
148154
nameSelector:
149155
namespace: west-data-center
150-
name: *
156+
name: "*"
151157
----

modules/ossm-federation-config-import.adoc

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ spec:
3333
importRules: # first matching rule is used
3434
# import ratings.bookinfo as ratings.bookinfo
3535
- type: NameSelector
36+
importAsLocal: false
3637
nameSelector:
37-
importAsLocal: false
3838
namespace: bookinfo
3939
name: ratings
4040
alias:
@@ -60,32 +60,35 @@ spec:
6060

6161
|spec:
6262
importRules:
63-
-type:
63+
- type:
6464
|Type of rule that will govern the import for the service. The first matching rule found for the service will be used for the import.
6565
|`NameSelector`
6666

6767
|spec:
6868
importRules:
69-
-type: NameSelector:
69+
- type: NameSelector
70+
nameSelector:
7071
namespace:
7172
name:
72-
|To create a `NameSelector` rule, specify the `namespace` of the service and the `name` of the service, as defined in the `Deployment` resource.
73+
|To create a `NameSelector` rule, specify the `namespace` and the `name` of the exported service.
7374
|
7475

7576
|spec:
7677
importRules:
77-
-type: NameSelector:
78-
importAsLocal:
78+
- type: NameSelector
79+
importAsLocal:
7980
|Set to `true` to aggregate remote endpoint with local services. When `true`, services will be imported as `<name>.<namespace>.svc.cluster.local`
8081
|`true`/`false`
8182

8283
|spec:
8384
importRules:
84-
-type: NameSelector:
85-
importAsLocal:
85+
- type: NameSelector
86+
nameSelector:
8687
namespace:
8788
name:
8889
alias:
90+
namespace:
91+
name:
8992
|To create a `NameSelector` rule that uses an alias for the service, after specifying the `namespace` and `name` for the service, then specify the alias for the `namespace` and the alias to be used for `name` of the service.
9093
|
9194
|===
@@ -104,8 +107,8 @@ metadata:
104107
spec:
105108
importRules:
106109
- type: NameSelector
110+
importAsLocal: false
107111
nameSelector:
108-
importAsLocal: false
109112
namespace: bookinfo
110113
name: ratings
111114
----
@@ -121,8 +124,8 @@ metadata:
121124
spec:
122125
importRules:
123126
- type: NameSelector
127+
importAsLocal: false
124128
nameSelector:
125-
importAsLocal: false
126129
namespace: west-data-center
127-
name: *
130+
name: "*"
128131
----

modules/ossm-federation-config-meshPeer.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ spec:
123123
|spec:
124124
security:
125125
certificateChain:
126-
|The name of a `ConfigMap` resource containing the root certificate used to validate the client certificate(s) presented to this mesh by the peer mesh.
127-
|<peerMesh>-ca-root-cert
126+
kind: ConfigMap
127+
name:
128+
|The kind (for example, ConfigMap) and name of a resource containing the root certificate used to validate the client and server certificate(s) presented to this mesh by the peer mesh.
129+
The key of the config map entry containing the certificate should be `root-cert.pem`.
130+
|kind: ConfigMap
131+
name: <peerMesh>-ca-root-cert
128132
|===

modules/ossm-federation-config-smcp.adoc

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ spec:
3434
service:
3535
metadata:
3636
labels:
37-
federation.maistra.io/proxy: egress-green-mesh
37+
federation.maistra.io/egress-for: egress-green-mesh
3838
ports:
3939
- port: 15443
4040
name: tls
@@ -48,7 +48,7 @@ spec:
4848
service:
4949
metadata:
5050
labels:
51-
federation.maistra.io/proxy: egress-blue-mesh
51+
federation.maistra.io/egress-for: egress-blue-mesh
5252
ports:
5353
- port: 15443
5454
name: tls
@@ -62,7 +62,7 @@ spec:
6262
type: LoadBalancer
6363
metadata:
6464
labels:
65-
federation.maistra.io/proxy: ingress-green-mesh
65+
federation.maistra.io/ingress-for: ingress-green-mesh
6666
ports:
6767
- port: 15443
6868
name: tls
@@ -75,7 +75,7 @@ spec:
7575
type: LoadBalancer
7676
metadata:
7777
labels:
78-
federation.maistra.io/proxy: ingress-blue-mesh
78+
federation.maistra.io/ingress-for: ingress-blue-mesh
7979
ports:
8080
- port: 15443
8181
name: tls
@@ -140,7 +140,8 @@ To avoid naming conflicts between meshes, you must create separate egress and in
140140
|spec:
141141
gateways:
142142
additionalEgress:
143-
requestedNetworkView:
143+
<egressName>:
144+
requestedNetworkView:
144145
|Networks associated with exported services.
145146
|Set to the value of `spec.cluster.network` in the SMCP for the mesh, otherwise use <ServiceMeshPeer-name>-network. For example, if the `ServiceMeshPeer` resource for that mesh is named `west`, then the network would be named `west-network`.
146147
|
@@ -149,8 +150,8 @@ To avoid naming conflicts between meshes, you must create separate egress and in
149150
gateways:
150151
additionalEgress:
151152
<egressName>:
152-
router mode:
153-
|
153+
routerMode:
154+
|The router mode to be used by the gateway.
154155
|`sni-dnat`
155156
|
156157

@@ -161,7 +162,7 @@ To avoid naming conflicts between meshes, you must create separate egress and in
161162
service:
162163
metadata:
163164
labels:
164-
federation.maistra.io/proxy:
165+
federation.maistra.io/egress-for:
165166
|Specify a unique label for the gateway to prevent federated traffic from flowing through the cluster's default system gateways.
166167
|
167168
|
@@ -196,8 +197,8 @@ To avoid naming conflicts between meshes, you must create separate egress and in
196197
gateways:
197198
additionalIngress:
198199
<ingressName>:
199-
router mode:
200-
|
200+
routerMode:
201+
|The router mode to be used by the gateway.
201202
|`sni-dnat`
202203
|
203204

@@ -218,7 +219,7 @@ To avoid naming conflicts between meshes, you must create separate egress and in
218219
service:
219220
metadata:
220221
labels:
221-
federation.maistra.io/proxy:
222+
federation.maistra.io/ingress-for:
222223
|Specify a unique label for the gateway to prevent federated traffic from flowing through the cluster's default system gateways.
223224
|
224225
|
@@ -304,7 +305,7 @@ Follow this procedure to edit the `ServiceMeshControlPlane` with the {product-ti
304305

305306
. Click the {ProductName} Operator.
306307

307-
. On the *Istio Service Mesh Control Plane* tab, click the name of your `ServiceMeshControlPlane`, for example `red-mesh-install`.
308+
. On the *Istio Service Mesh Control Plane* tab, click the name of your `ServiceMeshControlPlane`, for example `red-mesh`.
308309

309310
. On the *Create ServiceMeshControlPlane Details* page, click `YAML` to modify your configuration.
310311

@@ -333,11 +334,11 @@ $ oc project red-mesh-system
333334
+
334335
. Edit the `ServiceMeshControlPlane` file to add federation ingress and egress gateways and to specify the trust domain.
335336

336-
. Run the following command to edit the control plane where `red-mesh-system` is the system namespace and `red-mesh-install.yaml` includes a full path to the file you edited:
337+
. Run the following command to edit the control plane where `red-mesh-system` is the system namespace and `red-mesh` is the name of the `ServiceMeshControlPlane` object:
337338
+
338339
[source,terminal]
339340
----
340-
$ oc edit -n red-mesh-system -f red-mesh-install.yaml
341+
$ oc edit -n red-mesh-system smcp red-mesh
341342
----
342343
+
343344
. Enter the following command, where `red-mesh-system` is the system namespace, to see the status of the control plane installation.
@@ -347,9 +348,9 @@ $ oc edit -n red-mesh-system -f red-mesh-install.yaml
347348
$ oc get smcp -n red-mesh-system
348349
----
349350
+
350-
The installation has finished successfully when the READY column is true.
351+
The installation has finished successfully when the READY column indicates that all components are ready.
351352
+
352353
----
353-
NAME READY STATUS TEMPLATE VERSION AGE
354-
red-mesh-install 9/9 InstallSuccessful default v2.0 4m25s
354+
NAME READY STATUS PROFILES VERSION AGE
355+
red-mesh 10/10 ComponentsReady ["default"] 2.1.0 4m25s
355356
----

modules/ossm-federation-create-export.adoc

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ spec:
7272
exportRules:
7373
- type: NameSelector
7474
nameSelector:
75-
name:
76-
namespace: red-mesh-bookinfo
77-
name: red-ratings
75+
namespace: red-mesh-bookinfo
76+
name: ratings
7877
alias:
79-
Namespace: bookinfo
80-
name: ratings
78+
namespace: bookinfo
79+
name: red-ratings
80+
- type: NameSelector
81+
nameSelector:
82+
namespace: red-mesh-bookinfo
83+
name: reviews
8184
----
8285
+
8386
. Run the following command to upload and create the `ExportServiceSet` resource in the red-mesh-system namespace.
@@ -100,14 +103,14 @@ $ oc create -n red-mesh-system -f export-to-green-mesh.yaml
100103
+
101104
[source,terminal]
102105
----
103-
$ oc get exportedserviceset <PeerMeshExportedTo> -o yaml |yaml
106+
$ oc get exportedserviceset <PeerMeshExportedTo> -o yaml
104107
----
105108
+
106109
For example:
107110
+
108111
[source,terminal]
109112
----
110-
$ oc get exportedserviceset green-mesh -o yaml |yaml
113+
$ oc get exportedserviceset green-mesh -o yaml
111114
----
112115
+
113116
. Run the following command to validate the services the red-mesh exports to share with green-mesh:

modules/ossm-federation-create-import.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ metadata:
7272
spec:
7373
importRules:
7474
- type: NameSelector
75+
importAsLocal: false
7576
nameSelector:
76-
importAsLocal: false
77-
namespace: red-mesh-bookinfo
77+
namespace: bookinfo
7878
name: red-ratings
7979
alias:
8080
namespace: bookinfo
@@ -101,14 +101,14 @@ $ oc create -n green-mesh-system -f import-from-red-mesh.yaml
101101
+
102102
[source,terminal]
103103
----
104-
$ oc get importedserviceset <PeerMeshImportedInto> -o yaml |yaml
104+
$ oc get importedserviceset <PeerMeshImportedInto> -o yaml
105105
----
106106
+
107107
For example:
108108
+
109109
[source,terminal]
110110
----
111-
$ oc get importedserviceset green-mesh -o yaml |yaml
111+
$ oc get importedserviceset green-mesh -o yaml
112112
----
113113
+
114114
. Run the following command to validate the services imported into a mesh.

0 commit comments

Comments
 (0)