|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * service-mesh-docs-main/migrating/cluster-wide/ossm-migrating-cluster-wide-assembly.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="ossm-migrating-workloads-using-the-istio-injection-label_{context}"] |
| 7 | += Migrating workloads by using the istio injection label |
| 8 | + |
| 9 | +Now you can migrate your workloads from the {SMProduct} 2.6 control plane to the {SMproduct} 3.0 control plane. |
| 10 | + |
| 11 | +[NOTE] |
| 12 | +==== |
| 13 | +You can migrate workloads and gateways separately, and in any order. For more information, see "Migrating gateways". |
| 14 | +==== |
| 15 | + |
| 16 | +.Procedure |
| 17 | + |
| 18 | +. Find the current `IstioRevision` resource for your {SMProduct} 3.0 control plane by running the following command: |
| 19 | ++ |
| 20 | +[source,terminal] |
| 21 | +---- |
| 22 | +$ oc get istios |
| 23 | +---- |
| 24 | ++ |
| 25 | +.Example output |
| 26 | ++ |
| 27 | +[source,terminal] |
| 28 | +---- |
| 29 | +NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE |
| 30 | +ossm-3 1 1 0 ossm-3-v1-24-3 Healthy v1.24.3 30s |
| 31 | +---- |
| 32 | + |
| 33 | +. Copy the `ACTIVE REVISION` value to use as your `istio.io/rev` label in the next step. |
| 34 | ++ |
| 35 | +[NOTE] |
| 36 | +==== |
| 37 | +The naming format of your revisions depends on which upgrade strategy you choose for your `Istio` instance. |
| 38 | +==== |
| 39 | + |
| 40 | +. Update the injection labels on the data plane namespace by running the following command: |
| 41 | ++ |
| 42 | +[source,terminal] |
| 43 | +---- |
| 44 | +$ oc label ns bookinfo istio.io/rev=ossm-3-v1-24-3 maistra.io/ignore-namespace="true" istio-injection- --overwrite=true |
| 45 | +---- |
| 46 | ++ |
| 47 | +The `oc label` command performs the following actions: |
| 48 | + |
| 49 | +.. Removes the `istio-injection` label: This label prevents the 3.0 control plane from injecting the proxy. The `istio-injection` label takes precedence over the `istio.io/rev` label. You must temporarily remove the `istio-injection=enabled` because you cannot create the default `IstioRevisionTag` tag yet. Leaving the `istio-injection=enabled` label applied would prevent the 3.0 control plane from performing proxy injection. |
| 50 | + |
| 51 | +.. Adds the `istio.io/rev=ossm-3-v1-24-3` label: This label ensures that any newly created or restarted pods in the namespace connect to the {SMProduct} 3.0 proxy. |
| 52 | + |
| 53 | +.. Adds the `maistra.io/ignore-namespace: "true"` label: This label disables sidecar injection for {SMProduct} 2.6 proxies in the namespace. With the label applied, {SMProduct} 2.6 stops injecting proxies in this namespace, and any new proxies are injected by {SMProduct} 3.0. Without this label, the {SMProduct} 2.6 injection webhook tries to inject the pod and the injected sidecar proxy refuses to start since it will has both the {SMProduct} 2.6 and the {SMProduct} 3.0 Container Network Interface(CNI) annotations. |
| 54 | ++ |
| 55 | +[NOTE] |
| 56 | +==== |
| 57 | +After you apply the `maistra.io/ignore-namespace` label, any new pod that gets created in the namespace connects to the {SMProduct} 3.0 proxy. Workloads can still communicate with each other regardless of which control plane they are connected to. |
| 58 | +==== |
| 59 | + |
| 60 | +. Restart the workloads by using one of the following options: |
| 61 | ++ |
| 62 | +.. To restart all the workloads at the same time so that the new pods are injected with the {SMProduct} 3.0 proxy, run the following command: |
| 63 | ++ |
| 64 | +.Example command for `bookinfo` application |
| 65 | +[source,terminal] |
| 66 | +---- |
| 67 | +$ oc rollout restart deployments -n bookinfo |
| 68 | +---- |
| 69 | + |
| 70 | +.. To restart each workload individually, run the following command for each workload: |
| 71 | ++ |
| 72 | +.Example command for `bookinfo` application |
| 73 | +[source,terminal] |
| 74 | +---- |
| 75 | +$ oc rollout restart deployments productpage-v1 -n bookinfo |
| 76 | +---- |
| 77 | + |
| 78 | +. Wait for the `productpage` application to restart by running the following command: |
| 79 | ++ |
| 80 | +[source,terminal] |
| 81 | +---- |
| 82 | +$ oc rollout status deployment productpage-v1 -n bookinfo |
| 83 | +---- |
| 84 | + |
| 85 | +.Verification |
| 86 | + |
| 87 | +. Verify that the the new control plane manages the expected workloads by running the following command: |
| 88 | ++ |
| 89 | +[source,terminal] |
| 90 | +---- |
| 91 | +$ istioctl ps -n bookinfo |
| 92 | +---- |
| 93 | ++ |
| 94 | +.Example output: |
| 95 | +[source,terminal] |
| 96 | +---- |
| 97 | +NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION |
| 98 | +details-v1-7f46897b-d497c.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 |
| 99 | +productpage-v1-74bfbd4d65-vsxqm.bookinfo Kubernetes SYNCED (4s) SYNCED (4s) SYNCED (3s) SYNCED (4s) IGNORED istiod-ossm-3-v1-24-3-797bb4d78f-xpchx 1.24.3 |
| 100 | +ratings-v1-559b64556-c5ppg.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 |
| 101 | +reviews-v1-847fb7c54d-qxt5d.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 |
| 102 | +reviews-v2-5c7ff5b77b-8jbhd.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 |
| 103 | +reviews-v3-5c5d764c9b-rrx8w.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED NOT SENT istiod-install-istio-system-866b57d668-6lpcr 1.20.8 |
| 104 | +---- |
| 105 | ++ |
| 106 | +The output shows that the `productpage-v1` deployment is the only deployment that has been restarted and was injected with the 3.0 proxy. Even if there are different versions of the proxies, communication between the services still works. |
| 107 | + |
| 108 | +. If the 2.6 installation contains additional namespaces, migrate the next namespace now. |
| 109 | ++ |
| 110 | +[NOTE] |
| 111 | +==== |
| 112 | +Remove the `maistra.io/ignore-namespace="true"` label only after the 2.6 control plane has been uninstalled. |
| 113 | +==== |
0 commit comments