Skip to content

Commit ca2f1b0

Browse files
authored
Add docs for multi-tenant ossm migration (openshift-service-mesh#168)
Signed-off-by: Nick Fox <[email protected]>
1 parent d337b38 commit ca2f1b0

File tree

3 files changed

+324
-1
lines changed

3 files changed

+324
-1
lines changed

docs/ossm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ This documentation is specific to the OpenShift Service Mesh product and may dif
1313
- [Installing the Sidecar](./injection/README.md)
1414
- [Multiple Istio Control Planes in a Single Cluster](./multi-control-planes/README.md)
1515
- [Security Mutual TLS Configuration](./security/security-mTLS-configuration.md)
16-
16+
- [2.X to 3.0 migration guide](./ossm2-migration/README.md)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# OpenShift Service Mesh 2.6 migration to 3.0
2+
3+
This document details how to migrate from 2.6 to OpenShift Service Mesh 3.0.
4+
5+
## Pre-migration Checklist
6+
7+
Before you begin to migrate your controlplane from OpenShift Service Mesh 2.6 to 3.0, ensure you have done the following:
8+
9+
- Upgrade your 2.6 OpenShift Service Mesh Operator to the latest release.
10+
- Upgrade your `ServiceMeshControlPlane` version to the latest OpenShift Service Mesh release.
11+
- Disable the following features on your `ServiceMeshControlPlane`. These fields are unsupported in 3.0 and must be disabled prior to migration.
12+
<!-- TODO: create a separate page for each of these bullet points describing how to migrate off the SMCP managed version. -->
13+
<!-- TODO: revisit this list when: https://issues.redhat.com/browse/OSSM-8299 is completed. -->
14+
- Network Policy management: `spec.security.manageNetworkPolicy=false`. If you wish to keep the Network Policies created by the 2.6 `ServiceMeshControlPlane`, you will need to recreate and manage these manually.
15+
- Disabled addons:
16+
- Prometheus: `spec.addons.prometheus.enabled=false`
17+
- Kiali: `spec.addons.kiali.enabled=false`
18+
- Grafana: `spec.addons.grafana.enabled=false`
19+
- Tracing: `spec.tracing.type=None`
20+
- IOR is disabled.
21+
- Default ingress/egress gateways are disabled.
22+
23+
Now you are ready to migrate. Check the `spec.mode` field on your `ServiceMeshControlPlane` resource to determine if you are running a `MultiTenant` or a `ClusterWide` mesh.
24+
25+
```sh
26+
oc get smcp <smcp-name> -n <smcp-namespace> -o jsonpath='{.spec.mode}'
27+
```
28+
29+
For `MultiTenant` meshes, follow [these instructions](./multi-tenancy/README.md). For `ClusterWide` meshes, follow [these instructions](#TODO).
Lines changed: 294 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
# OpenShift Service Mesh 2 --> 3 Multi-tenancy Migration guide
2+
3+
This guide is for users who are currently running `MultiTenant` OpenShift Service Mesh 2.6 migrating to OpenShift Service Mesh 3.0. You should first read [this document comparing OpenShift Service Mesh 2 vs. OpenShift Service Mesh 3](../../ossm2-vs-ossm3.md) to familiarize yourself with the concepts between the two versions and the differences in manging `MultiTenant` workloads. Specifically the [Scoping the Mesh section](../../ossm2-vs-ossm3.md#scoping-of-the-mesh-discovery-selectors-and-labels-replace-servicemeshmemberroll-and-servicemeshmember) is important for migrating from OpenShift Service Mesh 2 to OpenShift Service Mesh 3.
4+
5+
## Migrating OpenShift Service Mesh 2 Multi-Tenant to OpenShift Service Mesh 3
6+
7+
### Prerequisites
8+
9+
- OSSM2 operator is installed
10+
- OSSM3 operator is installed
11+
- `IstioCNI` is installed
12+
- `istioctl` is installed
13+
- MultiTenant `ServiceMeshControlPlane`
14+
15+
### Procedure
16+
17+
In this example, we'll be using the [bookinfo demo](https://raw.githubusercontent.com/Maistra/istio/maistra-2.6/samples/bookinfo/platform/kube/bookinfo.yaml) but you can follow these same steps with your own workloads.
18+
19+
Before you begin, please ensure that you have completed all the steps in the [pre-migration checklist](../README.md#pre-migration-checklist).
20+
21+
<!-- Developer instructions for testing with a fresh 2.6 install.
22+
23+
1. Create SMCP namespace
24+
25+
```sh
26+
oc create ns istio-system-tenant-a
27+
```
28+
29+
1. Create SMCP
30+
31+
```yaml
32+
apiVersion: maistra.io/v2
33+
kind: ServiceMeshControlPlane
34+
metadata:
35+
name: basic
36+
namespace: istio-system-tenant-a
37+
spec:
38+
security:
39+
manageNetworkPolicy: false
40+
dataPlane:
41+
mtls: true
42+
addons:
43+
grafana:
44+
enabled: false
45+
kiali:
46+
enabled: false
47+
prometheus:
48+
enabled: false
49+
gateways:
50+
openshiftRoute:
51+
enabled: false
52+
mode: MultiTenant
53+
policy:
54+
type: Istiod
55+
profiles:
56+
- default
57+
telemetry:
58+
type: Istiod
59+
tracing:
60+
type: None
61+
version: v2.6
62+
```
63+
64+
1. Create bookinfo namespace
65+
66+
```sh
67+
oc create ns bookinfo
68+
```
69+
70+
1. Add bookinfo to the SMMR
71+
72+
```yaml
73+
apiVersion: maistra.io/v1
74+
kind: ServiceMeshMemberRoll
75+
metadata:
76+
name: default
77+
namespace: istio-system-tenant-a
78+
spec:
79+
members:
80+
- bookinfo
81+
```
82+
83+
1. Deploy bookinfo
84+
85+
```sh
86+
oc apply -n bookinfo -f https://raw.githubusercontent.com/Maistra/istio/maistra-2.6/samples/bookinfo/platform/kube/bookinfo.yaml
87+
```
88+
89+
1. Ensure pods are all healthy and you see `2/2` pods indicating a sidecar was injected.
90+
91+
```sh
92+
oc get pods -n bookinfo
93+
```
94+
95+
Example output
96+
97+
```sh
98+
NAME READY STATUS RESTARTS AGE
99+
details-v1-75cb5b97b4-5c6nm 2/2 Running 0 6h13m
100+
productpage-v1-899d756d8-ch424 2/2 Running 0 6h10m
101+
ratings-v1-58757c649b-8bdg4 2/2 Running 0 6h13m
102+
reviews-v1-6878c868b6-42kw7 2/2 Running 0 6h13m
103+
reviews-v2-6c8bd45654-jpt76 2/2 Running 0 6h13m
104+
reviews-v3-57997d6ccd-j6pmh 2/2 Running 0 6h13m
105+
``` -->
106+
107+
#### Install OpenShift Service Mesh 3.0
108+
109+
1. Create your `Istio` resource.
110+
111+
Here we are setting `discoverySelectors` on our `Istio` resource. In 3.0, controlplanes by default watch the entire cluster and when managing multiple controlplanes on a single cluster, you must narrow the scope of each controlplane by setting `discoverySelectors`. In this example, we use the label `tenant` but you can use any label or combination of labels that you choose.
112+
113+
```yaml
114+
apiVersion: sailoperator.io/v1alpha1
115+
kind: Istio
116+
metadata:
117+
name: istio-tenant-a
118+
spec:
119+
namespace: istio-system-tenant-a
120+
values:
121+
meshConfig:
122+
discoverySelectors:
123+
- matchLabels:
124+
tenant: tenant-a
125+
version: v1.23.0
126+
```
127+
128+
> [!WARNING]
129+
> It is important your `Istio` resource's `spec.namespace` field is the **same** namespace as your `ServiceMeshControlPlane`. If you set your `Istio` resource's `spec.namespace` field to a different namespace than your `ServiceMeshControlPlane`, the migration will not work properly. In this example, we assume that your `ServiceMeshControlPlane` is found in the `istio-system-tenant-a` namespace.
130+
131+
2. Add your `tenant` label to each one of your dataplane namespaces.
132+
133+
With 2.6, we enrolled namespaces into the mesh by adding them to the Service Mesh Member Roll resource. In 3.0, you must label each one of your dataplane namespaces with this label. For every namespace in your Service Mesh Member Roll, add your tenant label to the namespace.
134+
135+
```sh
136+
oc label ns bookinfo tenant=tenant-a
137+
```
138+
139+
Now we are ready to migrate our workloads from our 2.6 controlplane to our 3.0 controlplane.
140+
141+
#### Migrate Workloads
142+
143+
1. Update injection labels on the dataplane namespace.
144+
145+
Here we're adding two labels to the namespace:
146+
147+
1. The `istio.io/rev: istio-tenant-a` label which ensures that any new pods that get created in that namespace will connect to the 3.0 proxy.
148+
2. The `maistra.io/ignore-namespace: "true"` label which will disable sidecar injection for 2.6 proxies in the namespace. This ensures that 2.6 will stop injecting proxies in this namespace and any new proxies will be injected by the 3.0 controlplane. Without this, the 2.6 injection webhook will try to inject the pod and it will connect to the 2.6 proxy as well as refuse to start since it will have the 2.6 cni annotation.
149+
150+
**Note:** that once you apply the `maistra.io/ignore-namespace` label, any new pod that gets created in the namespace will be connected to the 3.0 proxy. Workloads will still be able to communicate with each other though regardless of which controlplane they are connected to.
151+
152+
```sh
153+
oc label ns bookinfo istio.io/rev=istio-tenant-a maistra.io/ignore-namespace="true" --overwrite=true
154+
```
155+
156+
1. `curl` the productpage pod in `bookinfo` to ensure proxies can still communicate with one another.
157+
158+
```sh
159+
oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpage
160+
```
161+
162+
You should see
163+
164+
```html
165+
...
166+
<p>Absolutely fun and entertaining. The play lacks thematic depth when compared to other plays by Shakespeare.</p>
167+
<small>Reviewer2</small>
168+
169+
170+
<font color="black">
171+
<!-- full stars: -->
172+
173+
<span class="glyphicon glyphicon-star"></span>
174+
175+
<span class="glyphicon glyphicon-star"></span>
176+
177+
<span class="glyphicon glyphicon-star"></span>
178+
179+
<span class="glyphicon glyphicon-star"></span>
180+
181+
<!-- empty stars: -->
182+
183+
<span class="glyphicon glyphicon-star-empty"></span>
184+
185+
</font>
186+
187+
188+
</blockquote>
189+
190+
<dl>
191+
<dt>Reviews served by:</dt>
192+
<u>reviews-v2-6dd458b5db-frrlb</u>
193+
194+
</dl>
195+
...
196+
```
197+
198+
1. Migrate workloads.
199+
200+
You can now restart the workloads so that the new pod will be injected with the 3.0 proxy.
201+
202+
This can be done all at once:
203+
204+
```sh
205+
oc rollout restart deployments -n bookinfo
206+
```
207+
208+
or individually:
209+
210+
```sh
211+
oc rollout restart deployments productpage-v1 -n bookinfo
212+
```
213+
214+
1. Wait for the productpage app to restart.
215+
216+
```sh
217+
oc rollout status deployment productpage-v1 -n bookinfo
218+
```
219+
220+
#### Validate Workload Migration
221+
222+
1. Ensure the productpage app is connected to the new controlplane
223+
224+
You can see which proxies are still connected to the 2.6 controlplane with `istioctl`. Here `basic` should be the name of your `ServiceMeshControlPlane`:
225+
226+
```sh
227+
istioctl ps --istioNamespace istio-system-tenant-a --revision basic
228+
```
229+
230+
Example response:
231+
232+
```sh
233+
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION
234+
details-v1-7b49464bc-zr7nr.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-basic-6c9f8d9894-sh6lx 1.20.8
235+
ratings-v1-d6f449f59-9rds2.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-basic-6c9f8d9894-sh6lx 1.20.8
236+
reviews-v1-686cd989df-9x59z.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-basic-6c9f8d9894-sh6lx 1.20.8
237+
reviews-v2-785b8b48fc-l7xkj.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-basic-6c9f8d9894-sh6lx 1.20.8
238+
reviews-v3-67889ffd49-7bhxn.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-basic-6c9f8d9894-sh6lx 1.20.8
239+
```
240+
241+
And which proxies have been migrated to the new 3.0 controlplane:
242+
243+
```sh
244+
istioctl ps --istioNamespace istio-system-tenant-a --revision istio-tenant-a
245+
```
246+
247+
Example response:
248+
249+
```sh
250+
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION
251+
productpage-v1-7745c5cc94-wpvth.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED istiod-5bbf98dccf-n8566 1.23.0
252+
```
253+
254+
1. Ensure the `bookinfo` application is still working correctly.
255+
256+
```sh
257+
oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpage
258+
```
259+
260+
Example response:
261+
262+
```html
263+
...
264+
<p>Absolutely fun and entertaining. The play lacks thematic depth when compared to other plays by Shakespeare.</p>
265+
<small>Reviewer2</small>
266+
267+
268+
<font color="black">
269+
<!-- full stars: -->
270+
271+
<span class="glyphicon glyphicon-star"></span>
272+
273+
<span class="glyphicon glyphicon-star"></span>
274+
275+
<span class="glyphicon glyphicon-star"></span>
276+
277+
<span class="glyphicon glyphicon-star"></span>
278+
279+
<!-- empty stars: -->
280+
281+
<span class="glyphicon glyphicon-star-empty"></span>
282+
283+
</font>
284+
285+
286+
</blockquote>
287+
288+
<dl>
289+
<dt>Reviews served by:</dt>
290+
<u>reviews-v2-6dd458b5db-frrlb</u>
291+
292+
</dl>
293+
...
294+
```

0 commit comments

Comments
 (0)