Este contenido no está disponible en el idioma seleccionado.
Chapter 3. Multitenant migration guide
3.1. Multitenant migration guide Copiar enlaceEnlace copiado en el portapapeles!
This guide is for users who are currently running a multitenant deployment of Red Hat OpenShift Service Mesh 2.6.9, and are migrating to OpenShift Service Mesh 3.0.
If you have not completed the premigration checklists, you must complete them first before you can start migrating your deployment.
3.1.1. Migrating a multitenant deployment Copiar enlaceEnlace copiado en el portapapeles!
The bookinfo example application is being used for demonstration purposes with a minimal example for the Istio resource. For more information on configuration differences between the OpenShift Service Mesh 2 ServiceMeshControlPlane resource and the OpenShift Service Mesh 3 Istio resource, see "ServiceMeshControlPlane resource to Istio resource fields mapping".
You can follow these same steps with your own workloads.
Prerequisites
- You have deployed OpenShift Container Platform 4.14 or later.
- You are logged in to the OpenShift Container Platform web console as a user with the cluster-admin role.
- You have completed the premigration checklists.
- You have the OpenShift Service Mesh 2.6.9 Operator installed.
- You have the OpenShift Service Mesh 3 Operator installed.
-
You created an
IstioCNIresource. -
You have the
istioctltool installed. -
You are running a
MultiTenantServiceMeshControlPlane. -
You have installed the
bookinfoapplication.
Procedure
Create your
Istioresource.Example
IstioresourceCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
spec.namespacefield in yourIstioresource must be the same namespace as yourServiceMeshControlPlaneresource. If you set thespec.namespacefield in yourIstioresource to a different namespace than yourServiceMeshControlPlaneresource, the migration does not complete successfully. - 2
- By default, control planes watch the entire cluster. When managing multiple control planes on a single cluster, you must narrow the scope of each control plane by setting
discoverySelectorsfields. In this example, the labeltenant-ais used, but you can use any label or combination of labels. - 3
- Optional: If you are migrating metrics and tracing, update the
extensionProvidersfields according to your tracing and metrics configurations.
Add your
tenantlabel to each one of your dataplane namespaces by running the following command for each dataplane namespace:oc label ns bookinfo tenant=tenant-a
$ oc label ns bookinfo tenant=tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWith OpenShift Service Mesh 2.6, namespaces were enrolled into the mesh by adding them to the
ServiceMeshMemberRollresource. In OpenShift Service Mesh 3, you must label each one of your dataplane namespaces to match yourdiscoverySelectorsfields.
3.1.2. Migrating workloads in a multitenant deployment Copiar enlaceEnlace copiado en el portapapeles!
Now you can migrate your workloads from the OpenShift Service Mesh 2.6 control plane to the OpenShift Service Mesh 3.0 control plane.
You can migrate workloads and gateways separately, and in any order. For more information, see "Migrating gateways".
Procedure
Find the current
IstioRevisionfor your OpenShift Service Mesh 3.0 control plane by running the following command:oc get istios istio-tenant-a
$ oc get istios istio-tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE istio-tenant-a 1 1 0 istio-tenant-a Healthy v1.24.3 30s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE istio-tenant-a 1 1 0 istio-tenant-a Healthy v1.24.3 30sCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe naming format of your revisions depends on which upgrade strategy you choose for your
Istioinstance.-
Copy the
ACTIVE REVISIONto use as youristio.io/revlabel in the next step. Update injection labels on the
dataplanenamespace by running the following command:oc label ns bookinfo istio.io/rev=istio-tenant-a maistra.io/ignore-namespace="true" --overwrite=true
$ oc label ns bookinfo istio.io/rev=istio-tenant-a maistra.io/ignore-namespace="true" --overwrite=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow This adds the following labels to the namespace:
-
The
istio.io/rev: istio-tenant-alabel: Ensures that any new pods that get created in that namespace connect to the OpenShift Service Mesh 3.0 proxy. The
maistra.io/ignore-namespace: "true"label: Disables sidecar injection for OpenShift Service Mesh 2.6 proxies in the namespace so OpenShift Service Mesh 2.6 stops injecting proxies in this namespace, and any new proxies are injected by OpenShift Service Mesh 3.0. Without this label, the OpenShift Service Mesh 2.6 injection webhook tries to inject the pod and the injected sidecar proxy will refuse to start since it will have both the OpenShift Service Mesh 2.6 and the OpenShift Service Mesh 3.0 Container Network Interface(CNI) annotations.NoteOnce you apply the
maistra.io/ignore-namespacelabel, any new pod that gets created in the namespace will connect to the OpenShift Service Mesh 3.0 proxy. Workloads can still communicate with each other regardless of which controlplane they are connected to.
-
The
Restart the workloads by using one of the following options:
To restart all the workloads at once so that the new pods are injected with the OpenShift Service Mesh 3.0 proxy, run the following command:
Example command for
bookinfoapplicationoc rollout restart deployments -n bookinfo
$ oc rollout restart deployments -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow To restart each workload individually, run the following command for each workload:
Example command with
bookinfoapplicationoc rollout restart deployments productpage-v1 -n bookinfo
$ oc rollout restart deployments productpage-v1 -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Wait for the
productpageapplication to restart by running the following command:oc rollout status deployment productpage-v1 -n bookinfo
$ oc rollout status deployment productpage-v1 -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Check that your workload is connected to the new control plane.
Fetch the list of proxies that are still connected to the OpenShift Service Mesh 2.6 control plane with the
istioctltool by running the following command:istioctl ps --istioNamespace istio-system-tenant-a --revision basic
$ istioctl ps --istioNamespace istio-system-tenant-a --revision basicCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example,
basicis the name of yourServiceMeshControlPlane:Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow View the list proxies that have been migrated to the new OpenShift Service Mesh 3.0 control plane by running the following command:
istioctl ps --istioNamespace istio-system-tenant-a --revision istio-tenant-a
$ istioctl ps --istioNamespace istio-system-tenant-a --revision istio-tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION productpage-v1-7745c5cc94-wpvth.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED istiod-5bbf98dccf-n8566 1.24.3
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION productpage-v1-7745c5cc94-wpvth.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED istiod-5bbf98dccf-n8566 1.24.3Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verify your application is still working correctly. For the
bookinfoapplication, run the following command:oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpage
$ oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpageCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
If you are using gateways, you must migrate them before you complete the migration process for your deployment and workloads.
If you are not using gateways, and have verified your mulitenant migration, you can proceed to complete the migration and remove OpenShift Service Mesh 2 resources.
3.1.3. Migrating a multitenant deployment with cert-manager Copiar enlaceEnlace copiado en el portapapeles!
The bookinfo example application is being used for demonstration purposes with a minimal example for the Istio resource. For more information on configuration differences between the OpenShift Service Mesh 2 ServiceMeshControlPlane resource and the OpenShift Service Mesh 3 Istio resource, see "ServiceMeshControlPlane resource to Istio resource fields mapping".
You can follow these same steps with your own workloads.
Prerequisites
- You have deployed OpenShift Container Platform 4.14 or later.
- You are logged in to the OpenShift Container Platform web console as a user with the cluster-admin role.
- You have completed the premigration checklists.
- You have the OpenShift Service Mesh 2.6.9 Operator installed.
- You have the OpenShift Service Mesh 3 Operator installed.
-
You created an
IstioCNIresource. -
You have the
istioctltool installed. - You are using the cert-manager and istio-csr tools in a multitenant deployment.
-
Your OpenShift Service Mesh 2
ServiceMeshControlPlaneis configured with the cert-manager tool.
Procedure
Check that your OpenShift Service Mesh 2
ServiceMeshControlPlaneis configured with the cert-manager-tool:Example
ServiceMeshControlPlanecert-manager configurationCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the
istio-csrdeployment to include your OpenShift Service Mesh 3 control plane by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
app.istio.revisionsfield needs to include your OpenShift Service Mesh 3.0 control plane revision before you create yourIstioresource so that proxies can properly communicate with the OpenShift Service Mesh 3.0 control plane.
Create your
Istioresource.Example
Istioresource with cert-managerCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
spec.namespacefield in yourIstioresource must be the same namespace as yourServiceMeshControlPlaneresource. If you set thespec.namespacefield in yourIstioresource to a different namespace than yourServiceMeshControlPlaneresource, the migration will not work properly. - 2
- By default, control planes watch the entire cluster. When managing multiple control planes on a single cluster, you must narrow the scope of each control plane by setting
discoverySelectorsfields. In this example, the labeltenant-ais used, but you can use any label or combination of labels. - 3
- Optional: If you are migrating metrics and tracing, update the
extensionProvidersfields according to your tracing and metrics configurations.
Add your
tenantlabel to each one of your dataplane namespaces by running the following command for each dataplane namespace:oc label ns bookinfo tenant=tenant-a
$ oc label ns bookinfo tenant=tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWith OpenShift Service Mesh 2.6, namespaces were enrolled into the mesh by adding them to the
ServiceMeshMemberRollresource. In OpenShift Service Mesh 3, you must label each one of your dataplane namespaces to match yourdiscoverySelectorsfields.
3.1.4. Migrating workloads in a multitenant deployment with cert-manager Copiar enlaceEnlace copiado en el portapapeles!
Now you can migrate your workloads from the OpenShift Service Mesh 2.6 control plane to the OpenShift Service Mesh 3.0 control plane.
You can migrate workloads and gateways separately, and in any order. For more information, see "Migrating gateways".
Procedure
Find the current
IstioRevisionfor your OpenShift Service Mesh 3.0 control plane by running the following command:oc get istios istio-tenant-a
$ oc get istios istio-tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE istio-tenant-a 1 1 0 istio-tenant-a Healthy v1.24.3 30s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE istio-tenant-a 1 1 0 istio-tenant-a Healthy v1.24.3 30sCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThe naming format of your revisions depends on which upgrade strategy you choose for your
Istioinstance.-
Copy the
ACTIVE REVISIONto use as youristio.io/revlabel in the next step. Update injection labels on the
dataplanenamespace by running the following command:oc label ns bookinfo istio.io/rev=istio-tenant-a maistra.io/ignore-namespace="true" --overwrite=true
$ oc label ns bookinfo istio.io/rev=istio-tenant-a maistra.io/ignore-namespace="true" --overwrite=trueCopy to Clipboard Copied! Toggle word wrap Toggle overflow This adds the following labels to the namespace:
-
The
istio.io/rev: istio-tenant-alabel: Ensures that any new pods that get created in that namespace connect to the OpenShift Service Mesh 3.0 proxy. The
maistra.io/ignore-namespace: "true"label: Disables sidecar injection for OpenShift Service Mesh 2.6 proxies in the namespace so OpenShift Service Mesh 2.6 stops injecting proxies in this namespace, and any new proxies are injected by OpenShift Service Mesh 3.0. Without this label, the OpenShift Service Mesh 2.6 injection webhook tries to inject the pod and the injected sidecar proxy will refuse to start since it will have both the OpenShift Service Mesh 2.6 and the OpenShift Service Mesh 3.0 Container Network Interface(CNI) annotations.NoteOnce you apply the
maistra.io/ignore-namespacelabel, any new pod that gets created in the namespace connects to the OpenShift Service Mesh 3.0 proxy. Workloads can still communicate with each other regardless of which controlplane they are connected to.
-
The
Restart the workloads by using one of the following options:
To restart all the workloads at once so that the new pods are injected with the OpenShift Service Mesh 3.0 proxy, run the following command:
Example command for
bookinfoapplicationoc rollout restart deployments -n bookinfo
$ oc rollout restart deployments -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow To restart each workload individually, run the following command for each workload:
Example command with
bookinfoapplicationoc rollout restart deployments productpage-v1 -n bookinfo
$ oc rollout restart deployments productpage-v1 -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Wait for the
productpageapplication to restart by running the following command:oc rollout status deployment productpage-v1 -n bookinfo
$ oc rollout status deployment productpage-v1 -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Check that your workload is connected to the new control plane.
Fetch the list of proxies that are still connected to the OpenShift Service Mesh 2.6 control plane with the
istioctltool by running the following command:istioctl ps --istioNamespace istio-system-tenant-a --revision basic
$ istioctl ps --istioNamespace istio-system-tenant-a --revision basicCopy to Clipboard Copied! Toggle word wrap Toggle overflow In this example,
basicis the name of yourServiceMeshControlPlane:Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow View the list proxies that have been migrated to the new OpenShift Service Mesh 3.0 control plane by running the following command:
istioctl ps --istioNamespace istio-system-tenant-a --revision istio-tenant-a
$ istioctl ps --istioNamespace istio-system-tenant-a --revision istio-tenant-aCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION productpage-v1-7745c5cc94-wpvth.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED istiod-5bbf98dccf-n8566 1.24.3
NAME CLUSTER CDS LDS EDS RDS ECDS ISTIOD VERSION productpage-v1-7745c5cc94-wpvth.bookinfo Kubernetes SYNCED SYNCED SYNCED SYNCED istiod-5bbf98dccf-n8566 1.24.3Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verify your application is still working correctly. For the
bookinfoapplication, run the following command:oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpage
$ oc exec -it -n bookinfo deployments/productpage-v1 -c istio-proxy -- curl localhost:9080/productpageCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Next steps
If you are using gateways, you must migrate them before you can complete the migration process for your deployment and workloads.
After you have migrated your gateways, you must update the app.controller.configmapNamespaceSelector field in your istio-csr deployment.
If you are not using gateways, you can complete your migration with cert-manager.