|
| 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-istio-injection-label-with-cert-manager_{context}"] |
| 7 | += Migrating a cluster-wide deployment by using the Istio injection label with cert-manager |
| 8 | + |
| 9 | +You can perform a canary upgrade with the gradual migration of data plane namespaces for a cluster-wide deployment by using the `istio-injection=enabled` label and the `default` revision tag. |
| 10 | + |
| 11 | +You must relabel all of the data plane namespaces. However, it is safe to restart any of the workloads at any point during the migration process. |
| 12 | + |
| 13 | +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". |
| 14 | + |
| 15 | +.Prerequisites |
| 16 | + |
| 17 | +* You have deployed {ocp-product-title} 4.14 or later. |
| 18 | +* You have logged in to the {ocp-product-title} web console as a user with the `cluster-admin` role. |
| 19 | +* You have completed the premigration checklists. |
| 20 | +* You have the {SMProduct} {SMv2Version} Operator installed. |
| 21 | +* You have the {SMProduct} 3 Operator installed. |
| 22 | +* You have created an `IstioCNI` resource. |
| 23 | +* You have installed the `istioctl` tool. |
| 24 | +* You are using the cert-manager and istio-csr tools in a cluster-wide deployment. |
| 25 | +* Your {SMProduct} {SMv2Version} `ServiceMeshControlPlane` resource is configured with the cert-manager tool. |
| 26 | +* You have installed the `bookinfo` application. |
| 27 | +
|
| 28 | +.Procedure |
| 29 | + |
| 30 | +. Check that your {SMProduct} 2 `ServiceMeshControlPlane` resource is configured with the cert-manager-tool: |
| 31 | ++ |
| 32 | +.Example `ServiceMeshControlPlane` cert-manager configuration |
| 33 | +[source,yaml] |
| 34 | +---- |
| 35 | +apiVersion: maistra.io/v2 |
| 36 | +kind: ServiceMeshControlPlane |
| 37 | +metadata: |
| 38 | + name: basic |
| 39 | + namespace: istio-system |
| 40 | +spec: |
| 41 | + ... |
| 42 | + security: |
| 43 | + certificateAuthority: |
| 44 | + cert-manager: |
| 45 | + address: cert-manager-istio-csr.istio-system.svc:443 |
| 46 | + type: cert-manager |
| 47 | + dataPlane: |
| 48 | + mtls: true |
| 49 | + identity: |
| 50 | + type: ThirdParty |
| 51 | + manageNetworkPolicy: false |
| 52 | +---- |
| 53 | + |
| 54 | +. Update the `istio-csr` deployment to include your {SMProduct} 3 control plane by running the following command: |
| 55 | ++ |
| 56 | +[source,terminal] |
| 57 | +---- |
| 58 | + helm upgrade cert-manager-istio-csr jetstack/cert-manager-istio-csr \ |
| 59 | + --install \ |
| 60 | + --reuse-values \ |
| 61 | + --namespace istio-system \ |
| 62 | + --wait \ |
| 63 | + --set "app.istio.revisions={basic,ossm-3-v1-24-3}" <1> |
| 64 | +---- |
| 65 | ++ |
| 66 | +<1> The `app.istio.revisions` field needs to include your {SMProduct} 3.0 control plane revision _before_ you create your `Istio` resource so that proxies can properly communicate with the {SMProduct} 3.0 control plane. |
| 67 | +
|
| 68 | +. Identify the namespaces that contain a 2.6 control plane by running the following command: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ oc get smcp -A |
| 73 | +---- |
| 74 | ++ |
| 75 | +.Example output: |
| 76 | +[source,terminal] |
| 77 | +---- |
| 78 | +NAMESPACE NAME READY STATUS PROFILES VERSION AGE |
| 79 | +istio-system install-istio-system 6/6 ComponentsReady ["default"] 2.6.6 115m |
| 80 | +---- |
| 81 | +
|
| 82 | +. 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. |
| 83 | ++ |
| 84 | +[NOTE] |
| 85 | +==== |
| 86 | +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 plan 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. |
| 87 | +==== |
| 88 | ++ |
| 89 | +.Example `Istio` resource |
| 90 | +[source,yaml,subs="attributes,verbatim"] |
| 91 | +---- |
| 92 | +apiVersion: sailoperator.io/v1 |
| 93 | +kind: Istio |
| 94 | +metadata: |
| 95 | + name: ossm-3 # <1> |
| 96 | +spec: |
| 97 | + updateStrategy: |
| 98 | + type: RevisionBased |
| 99 | + namespace: istio-system # <2> |
| 100 | + version: v1.24.3 |
| 101 | + values: |
| 102 | + meshConfig: |
| 103 | + extensionProviders: # <3> |
| 104 | + - name: prometheus |
| 105 | + prometheus: {} |
| 106 | + - name: otel |
| 107 | + opentelemetry: |
| 108 | + port: 4317 |
| 109 | + service: otel-collector.opentelemetrycollector-3.svc.cluster.local |
| 110 | + global: |
| 111 | + caAddress: cert-manager-istio-csr.istio-system.svc:443 |
| 112 | + pilot: |
| 113 | + env: |
| 114 | + ENABLE_CA_SERVER: "false" |
| 115 | +---- |
| 116 | +<1> The `name`, `updateStrategy`, and `version` fields specify how the `IstioRevision` resource name is created. For more information, see "Identifying the revision name". |
| 117 | +<2> The 3.0 and 2.6 control planes must run in the same namespace. |
| 118 | +<3> If you are migrating metrics and tracing, update the `extensionProviders` fields according to your tracing and metrics configurations. |
| 119 | ++ |
| 120 | +[NOTE] |
| 121 | +==== |
| 122 | +The proxies with the `istio-injection=enabled` label applied and are still managed by {SMProduct} 2.6 control plane. To prevent the {SMProduct} 3.0 control plane from injecting proxies in the namespaces that are still managed by {SMProduct} 2.6 control plane, do not use the default name for the Istio resource, and do not create the default revision tag in the following steps. You create the default revision tag later in this procedure. |
| 123 | +==== |
| 124 | +
|
| 125 | +. Apply the YAML file by running the following command: |
| 126 | ++ |
| 127 | +[source,terminal] |
| 128 | +---- |
| 129 | +$ oc apply -f ossm-3.yaml |
| 130 | +---- |
| 131 | +
|
| 132 | +. Verify that the new `istiod` resource uses the existing root certificate by running the following command: |
| 133 | ++ |
| 134 | +[source,terminal] |
| 135 | +---- |
| 136 | +$ oc logs deployments/istiod-ossm-3-v1-24-3 -n istio-system | grep 'Load signing key and cert from existing secret' |
| 137 | +---- |
| 138 | ++ |
| 139 | +.Example output: |
| 140 | +[source,terminal] |
| 141 | +---- |
| 142 | +2024-12-18T08:13:53.788959Z info pkica Load signing key and cert from existing secret istio-system/istio-ca-secret |
| 143 | +---- |
0 commit comments