Este contenido no está disponible en el idioma seleccionado.
Chapter 5. Migrating gateways
5.1. Migrating gateways Copiar enlaceEnlace copiado en el portapapeles!
If you are using gateways with Red Hat OpenShift Service Mesh 2.6.9 and migrating them to OpenShift Service Mesh 3.0, you can migrate gateways from OpenShift Service Mesh 2 to OpenShift Service Mesh 3 just like regular workloads.
Use one of the following two methods for migrating gateways from Red Hat OpenShift Service Mesh 2 to OpenShift Service Mesh 3:
- Gateway canary migration
- Gateway in place migration
5.1.1. Gateway canary migration Copiar enlaceEnlace copiado en el portapapeles!
Use the gateway canary migration method when you want a gradual rollout. It uses multiple gateway versions with maximum control over your gateway rollout.
The label for the gateway namespace differs between mulitenant and cluster-wide meshes. To understand which labels to use in your specific migration case and the maistra.io/ignore-namespace: "true" label requirement, see the "Multitenant migration guide" or the "Cluster-wide migration guide" section.
Procedure
Run the following command to label the gateway namespace to ensure that gateway injection is enabled from the new mesh and add the
maistra.io/ignore-namespace: "true"label:oc label namespace <gateway_namespace> istio.io/rev=<istio_revision_name> maistra.io/ignore-namespace="true"
$ oc label namespace <gateway_namespace> istio.io/rev=<istio_revision_name> maistra.io/ignore-namespace="true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Remove the
istio-injection=enabledlabel, if needed.
-
Remove the
Deploy a canary gateway by using the following example:
Example YAML for canary gateway
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Ensure that the new gateway deployment is running with the new revision and is handling requests:
-
Check that pods are running and in the
Readystatus. Check that the gateway is running the new revision by running the following command:
istioctl ps -n istio-ingress
$ istioctl ps -n istio-ingressCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Test a sample route through the gateway.
-
Check that pods are running and in the
Gradually shift traffic between deployments:
Increase replicas for new gateway by running the following command:
oc scale -n istio-ingress deployment/<new_gateway_deployment> --replicas <new_number_of_replicas>
$ oc scale -n istio-ingress deployment/<new_gateway_deployment> --replicas <new_number_of_replicas>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Decrease replicas for old gateway by running the following command:
oc scale -n istio-ingress deployment/<old_gateway_deployment> --replicas <new_number_of_replicas>
$ oc scale -n istio-ingress deployment/<old_gateway_deployment> --replicas <new_number_of_replicas>Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Repeat this process, incrementally adjusting replica counts until the new gateway handles all traffic to the gateway Service.
Next steps
5.1.2. Gateway in place migration Copiar enlaceEnlace copiado en el portapapeles!
If you need less detailed control over your gateway migration, you can perform gateway in place migration. This method applies to namespaces with dedicated gateways and to environments using a centralized gateway shared across multiple namespaces.
The label for the gateway namespace differs between mulitenant and cluster-wide meshes. To understand which labels to use in your specific migration case and the maistra.io/ignore-namespace: "true" label requirement, see the "Multitenant migration guide" or the "Cluster-wide migration guide" section.
Procedure
Run the following command to label the gateway namespace to ensure that gateway injection is enabled from the new mesh and add the
maistra.io/ignore-namespace: "true"label:oc label namespace <gateway_namespace> istio.io/rev=<istio_revision_name> maistra.io/ignore-namespace="true"
$ oc label namespace <gateway_namespace> istio.io/rev=<istio_revision_name> maistra.io/ignore-namespace="true"Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Remove the
istio-injection=enabledlabel, if needed.
-
Remove the
Restart the gateway deployment by running the following command:
oc -n ${app_namespace} rollout restart deployment ${gateway_name}$ oc -n ${app_namespace} rollout restart deployment ${gateway_name}Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Check that the gateway is running the new revision by running the following command:
istioctl ps -n istio-ingress
$ istioctl ps -n istio-ingressCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Test application-specific routes.
Next steps