These steps are specific to installations that identified that the ingress
gateway of the [Istio on GKE](https://docs.cloud.google.com/kubernetes-engine/docs/tutorials/secure-services-istio.md.txt)
was configured in their cluster. In this process Cloud Service Mesh version
1.19 is installed with the managed control plane.

> [!IMPORTANT]
> **Important:** If you installed the bundled version of Istio that is included by default with the "*GKE add-on* ", you must instead follow the steps in [migrate the bundled Istio to Cloud Service Mesh](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/install-configure-mesh.md.txt).

## Before you begin

- Migrating from the "*Istio add-on* " requires that you to use Cloud Service Mesh
  with the
  [Google-managed control plane](https://docs.cloud.google.com/service-mesh/docs/managed/supported-features-mcp).
  Therefore, the Cloud Service Mesh
  [In-cluster control plane](https://docs.cloud.google.com/service-mesh/docs/supported-features-in-cluster.md.txt) is not
  a supported migration option.

- You must first review and ensure that you meet the
  [requirements for upgrading](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade.md.txt).

- The commands on this page use the environment variables and migration script
  from the [upgrade preparation step](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare.md.txt).

- It is important that you perform each step of this process in the
  [specified order](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade.md.txt#upgrading).

## Overview

In general, the process for migrating from the "*Istio add-on*" to Cloud Service Mesh
with the managed control plane includes:

1. Installing the Cloud Service Mesh managed control plane.
2. Using the [migration script](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare.md.txt) to configure the Cloud Service Mesh ingress gateway.

## Migrate to Cloud Service Mesh version 1.19

You must follow the detailed instructions in the Cloud Service Mesh document
"*Migrating from Istio on GKE to Cloud Service Mesh*".
After you complete the installation and have migrated your
workloads, return to this page to complete the remaining configuration steps.

1. Use the "Istio add-on migration instructions" to migrate your installation to
   Cloud Service Mesh with the Google-managed control plane.

   Key items to be aware of during that process:
   - If you are prompted that the `custom envoy filters are not supported`.
     Simply, choose "yes" to continue the migration. Example:

         Detected custom envoy filters are not supported by Cloud Service Mesh.
         Please remove these if possible
         NAMESPACE    NAME                                 AGE
         gke-system   allowconnect-cluster-local-gateway   26m
         Continue anyways? [y/N] Y

   - The migration instructions include the section
     *Complete a successful migration* , which performs steps to finalize your
     Cloud Service Mesh installation.
     **Important**: After performing those steps, you will no longer be able to
     rollback your changes.

   **Istio add-on migration instructions** :
   [Migrating from Istio on GKE to Cloud Service Mesh](https://docs.cloud.google.com/service-mesh/docs/migrate-istio-to-anthos-service-mesh.md.txt)
2. After you complete the migration steps and have
   [Migrated your workload to Cloud Service Mesh](https://docs.cloud.google.com/service-mesh/docs/migrate-istio-to-anthos-service-mesh.md.txt),
   run the following commands to restart and label your ingress pods in the
   `knative-serving` namespace:

   1. Restart your ingress pods:

      ```bash
      kubectl rollout restart deployment autoscaler activator webhook -n knative-serving
      ```
   2. Add the `istio: ingressgateway` label:

      ```bash
      kubectl patch deployment ${INGRESS_NAME} --namespace ${INGRESS_NAMESPACE} --patch  '{"spec": {"template": {"metadata": {"labels": {"istio": "ingressgateway"}}}}}'
      ```

## Configure Cloud Service Mesh Ingress

In this section, the [migration script](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare.md.txt) is used to
set the
[release channel](https://docs.cloud.google.com/service-mesh/docs/release-channels-managed-service-mesh#how_to_select_a_release_channel)
to `asm-managed-rapid` for the Cloud Service Mesh managed control plane.

Run the following command to start the migration script:

```bash
 ./migration-addon.sh \
 --asm-revision asm-managed-rapid \
 --command set-up-asm-ingress
```

## What's next

[Install the fleet component](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/fleet-install-script.md.txt)

## Rollback

If you need to rollback the changes that you made through the steps above, you
can:

- Use the migration script to delete the Cloud Service Mesh ingress.
- Rollback the installation of Cloud Service Mesh.

To rollback the installation and configuration of Cloud Service Mesh with the
Google-managed control plane:

1. Run the following command to delete the Cloud Service Mesh ingress:

   ```bash
   ./migration-addon.sh --command rollback-set-up-asm-ingress
   ```

   The terminal output during the process looks similar to the following:

       Deleting Cloud Service Mesh ingress
       deployment.apps "istio-ingressgateway" deleted
       horizontalpodautoscaler.autoscaling "istio-ingressgateway" deleted
       role.rbac.authorization.k8s.io "istio-ingressgateway-sds" deleted
       rolebinding.rbac.authorization.k8s.io "istio-ingressgateway-sds" deleted
       Cloud Service Mesh ingress is successfully deleted.

2. To verify the rollback, check that the `istio-ingressgateway` service
   no longer exists in the `gke-system` namespace:

   ```bash
   kubectl get deployment istio-ingressgateway -n gke-system
   ```
3. [Rollback Cloud Service Mesh installation](https://docs.cloud.google.com/service-mesh/docs/upgrade/upgrade.md.txt#rollback).

4. Run the following command to re-enable the "*Istio add-on*":

   ```bash
   ./migration-addon.sh --command rollback-uninstall-istio-addon
   ```
5. To continue rolling back your changes to your installation's original state,
   [rollback the Istio add-on](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/uninstall-istio-addon.md.txt#rollback).