These steps are specific to installations of the
Istio on GKE, also referred
to as the "*Istio add-on*".

> [!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/uninstall-istio-addon.md.txt).

## Before you begin

- 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).

## Identify if the *Istio add-on* is in use

There are two possible paths for migration depending on if either the ingress
gateway or sidecar injection feature of the *Istio add-on* is in use within your
cluster.

1. Earlier in the [preparation step](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/prepare.md.txt#istioaddon), you
   already identified if the *Istio add-on* is configured. You can run the
   following command to verify that the `istio-system` namespace exists:

   ```bash
   echo $INGRESS_NAMESPACE
   ```
2. Run the following command to determine if the sidecar injection feature of
   the *Istio add-on* is in use within your cluster:

   ```bash
   kubectl get ns -l istio-injection=enabled
   ```

   If any namespace, other than `knative-serving` is listed, it indicates that
   sidecar injection of the *Istio add-on* is in use.

   For example, if the command only lists the `knative-serving` namespace, then
   you have not configured and do not use sidecar injection of the
   *Istio add-on*.

Results:

- **One or both used** - One or both of the *Istio add-on* features are in
  use within your cluster:

  - *Istio add-on* ingress service `istio-ingressgateway` is used.
  - *Istio add-on* sidecar injection is used.

  Next steps: After you follow the instruction in the next section to
  [uninstall the *Istio add-on*](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/uninstall-istio-addon.md.txt#uninstall), you must proceed to the
  [Cloud Service Mesh with the managed control plane](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/install-mesh-mcp.md.txt)
  guide.
- **Not used** - Neither the ingress gateway nor the sidecar injection of the
  *Istio add-on* are configure for use within your cluster. In other words,
  your installation uses the "bundled version of Istio".

  Next steps: After you follow the instruction in the next section to
  [uninstall the unused *Istio add-on*](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/uninstall-istio-addon.md.txt#uninstall), you can proceed to the
  [Cloud Service Mesh with the in-cluster control plane](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/install-configure-mesh.md.txt)
  guide.

## Uninstall the Istio add-on

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
uninstall the "*Istio add-on*".

1. Run the following command to start the migration script:

   ```bash
   ./migration-addon.sh --command uninstall-istio-addon
   ```
2. Verify that the `istio-system` namespace has been deleted:

   ```bash
   kubectl get ns istio-system --ignore-not-found
   ```

## What's next

Depending on the ingress gateway configuration that you identified above,
continue to the corresponding installation guide:

- If you [identified earlier](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/uninstall-istio-addon.md.txt#iduse) that one or both of the "*Istio add-on* "
  features were configured and used within your cluster, you must proceed to the
  [Cloud Service Mesh with the managed control plane](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/install-mesh-mcp.md.txt)
  guide.

- If you [identified earlier](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/uninstall-istio-addon.md.txt#iduse) that neither the ingress gateway nor the
  sidecar injection of the "Istio add-on" were used in your cluster, then
  your installation actually used the "bundled version of Istio". You can now
  proceed to install
  [Cloud Service Mesh with the in-cluster control plane](https://docs.cloud.google.com/kubernetes-engine/enterprise/knative-serving/docs/install/on-gcp/upgrade/install-configure-mesh.md.txt).

## Rollback

If you need to rollback the changes that you made through the steps above, you
can use the migration script to re-enable the "*Istio add-on*":

1. Run the following command:

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