|
| 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-a-cluster-wide-deployment-using-the-simple-migration-method_{context}"] |
| 7 | += Migrating a cluster-wide deployment by using the simple migration method |
| 8 | + |
| 9 | +You can perform a canary upgrade with the gradual migration of data plane namespaces for a cluster-wide deployment by using the simple migration method. In an {SMProduct} {SMv2Version} installation, if the `istio-injection=enabled` label is already applied to the data plane namespaces, the simple migration method is the easiest way to migrate from the {SMProduct} 2 installation to the {SMProduct} 3 installation. |
| 10 | + |
| 11 | +The simple migration method should not be used in production environments. |
| 12 | + |
| 13 | +[NOTE] |
| 14 | +==== |
| 15 | +Using the simple migration method to migrate from {SMProduct} 2 to {SMProduct} 3 might result in traffic disruption to the services running on a mesh. There are two methods to perform the cluster-wide migration without disrupting traffic. See "Migrating a cluster-wide deployment by using the istio injection label" or "Migrating a cluster-wide deployment by using the Istio revision label" for more information. |
| 16 | +==== |
| 17 | + |
| 18 | +The `bookinfo` application is used as an example for the `Istio` resource. For more information about configuration differences between the {SMProduct} 2 `ServiceMeshControlPlane` resource and the {SMProduct} 3 `Istio` resource, see "ServiceMeshControlPlane resource to Istio resource fields mapping." |
| 19 | + |
| 20 | +.Prerequisites |
| 21 | + |
| 22 | +* You have deployed {ocp-product-title} 4.14 or later. |
| 23 | +* You are logged in to the {ocp-product-title} web console as a user with the `cluster-admin` role. |
| 24 | +* You have completed the premigration checklists. |
| 25 | +* You have the {SMProduct} {SMv2Version} Operator installed. |
| 26 | +* You have the {SMProduct} 3 Operator installed. |
| 27 | +* You have created an `IstioCNI` resource. |
| 28 | +* You have installed the `istioctl` tool. |
| 29 | +* You are running a cluster-wide Service Mesh control plane resource. |
| 30 | +* You have installed the `bookinfo` application. |
| 31 | +
|
| 32 | +.Procedure |
| 33 | + |
| 34 | +. Identify the namespaces that contain a 2.6 control plane by running the following command: |
| 35 | ++ |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +$ oc get smcp -A |
| 39 | +---- |
| 40 | ++ |
| 41 | +.Example output |
| 42 | +[source,terminal] |
| 43 | +---- |
| 44 | +NAMESPACE NAME READY STATUS PROFILES VERSION AGE |
| 45 | +istio-system install-istio-system 6/6 ComponentsReady ["default"] 2.6.6 115m |
| 46 | +---- |
| 47 | + |
| 48 | +. Create a YAML file named `ossm-3.yaml`. This procedure creates the {istio} resource for the 3.0 installation in the same namespace as the `ServiceMeshControlPlane` resource for the 2.6 installation. |
| 49 | ++ |
| 50 | +[NOTE] |
| 51 | +==== |
| 52 | +In the following example configuration, the {istio} control plane has access to all namespaces on the cluster. If you want to limit the namespaces the control plane has access to, you must define discovery selectors. You must match all the data plane namespaces that you plan to migrate from version 2.6. |
| 53 | +==== |
| 54 | ++ |
| 55 | +.Example `Istio` resource |
| 56 | +[source,yaml,subs="attributes,verbatim"] |
| 57 | +---- |
| 58 | +apiVersion: sailoperator.io/v1 |
| 59 | +kind: Istio |
| 60 | +metadata: |
| 61 | + name: default # <1> |
| 62 | +spec: |
| 63 | + updateStrategy: |
| 64 | + type: InPlace |
| 65 | + namespace: istio-system # <2> |
| 66 | + version: v1.24.3 |
| 67 | + values: |
| 68 | + meshConfig: |
| 69 | + extensionProviders: # <3> |
| 70 | + - name: prometheus |
| 71 | + prometheus: {} |
| 72 | + - name: otel |
| 73 | + opentelemetry: |
| 74 | + port: 4317 |
| 75 | + service: otel-collector.opentelemetrycollector-3.svc.cluster.local |
| 76 | +---- |
| 77 | +<1> The `name`, `updateStrategy` and `version` fields specify how the `IstioRevision` resource name is created. For more information, see "Identifying the revision name." |
| 78 | +<2> The 3.0 and 2.6 control planes must run in the same namespace. |
| 79 | +<3> If you are migrating metrics and tracing, update the `extensionProviders` fields according to your tracing and metrics configurations. |
| 80 | ++ |
| 81 | +[NOTE] |
| 82 | +==== |
| 83 | +If the {istio} resource is named `default`, and the installation uses the `InPlace` update strategy, you can use the `istio-injection=enabled` label without creating the `IstioRevisionTag` tag. If you use a different name for the {istio} resource or you use the `RevisionBased` update strategy, you must configure the default `IstioRevisionTag` tag. For more information, see "Creating the default revision tag and relabeling the namespaces." |
| 84 | +==== |
| 85 | + |
| 86 | +. Apply the YAML file by running the following command: |
| 87 | ++ |
| 88 | +[source,terminal] |
| 89 | +---- |
| 90 | +$ oc apply -f ossm-3.yaml |
| 91 | +---- |
| 92 | ++ |
| 93 | +[NOTE] |
| 94 | +==== |
| 95 | +After you apply the YAML file, any time the workloads are restarted, both the {SMProduct} 2.6 and the {SMProduct} 3.0 control planes will try to inject side cars to all pods in namespaces that have the `istio-injection=enabled` label applied and to all pods that have the `sidecar.istio.io/inject="true"` label applied. This causes a traffic disruption. To prevent traffic disruption, restart the workloads only after the `maistra.io/ignore-namespace: "true"` label is added. |
| 96 | +==== |
| 97 | + |
| 98 | +.Verification |
| 99 | + |
| 100 | +. Verify that the new `istiod` resource uses the existing root certificate by running the following command: |
| 101 | ++ |
| 102 | +[source,terminal] |
| 103 | +---- |
| 104 | +$ oc logs deployments/istiod -n istio-system | grep 'Load signing key and cert from existing secret' |
| 105 | +---- |
| 106 | ++ |
| 107 | +.Example output |
| 108 | +[source,terminal] |
| 109 | +---- |
| 110 | +2024-12-18T08:13:53.788959Z info pkica Load signing key and cert from existing secret istio-system/istio-ca-secret |
| 111 | +---- |
0 commit comments