This page is part of a multi-page guide that explains how to migrate from Istio 1.8 or 1.9 to Anthos Service Mesh version 1.9.8 on a GKE cluster for a mesh containing multiple clusters that are in different Google Cloud projects. If you have an earlier version of Istio, you must upgrade first before migrating to Anthos Service Mesh. If you need to upgrade, go to the Upgrade Istio page in the applicable version of Istio. Note that Upgrading Istio across more than one minor version (e.g., 1.6.x to 1.8.x) in one step is not officially tested or recommended.
For migrations on a single-cluster mesh or for a mesh containing multiple clusters in the same Google Cloud project, refer to Installation, migration, and upgrade for GKE.
Before you begin
Before you install Anthos Service Mesh, make sure that you have:
- Set up your environment to install the tools that you need.
- Set up your project to enable the required APIs and set permissions.
- Set up your cluster to enable the required cluster options.
Preparing for the migration
Be sure to review Preparing to migrate from Istio.
To migrate from Istio, you follow the
revision upgrade process (referred to as
"canary" upgrades in the Istio documentation). With a revision-based upgrade,
you install a new revision of the control plane alongside the existing control
plane. When you run istioctl install
, you include an option to set a
revision
label that identifies the new control plane.
You then migrate to the new version by setting the same revision
label on your
workloads and performing a rolling restart to re-inject the proxies with the new
Anthos Service Mesh version and configuration. With this approach, you can monitor the
effect of the upgrade on a small percentage of your workloads. After testing
your application, you can migrate all traffic to the new revision. This approach
is much safer than doing an in-place upgrade where a new control plane
immediately replaces the previous version of the control plane.
Setting credentials and permissions
Initialize your project to ready it for installation. Among other things, this command creates a service account to let control plane components, such as the sidecar proxy, securely access your project's data and resources.
curl --request POST \ --header "Authorization: Bearer $(gcloud auth print-access-token)" \ --data '' \ "https://meshconfig.googleapis.com/v1alpha1/projects/${PROJECT_ID}:initialize"
The command responds with empty curly braces:
{}
Get authentication credentials to interact with the cluster. This command also sets the current context for
kubectl
to the cluster.gcloud container clusters get-credentials ${CLUSTER_NAME} \ --project=${PROJECT_ID}
Grant cluster admin permissions to the current user. You need these permissions to create the necessary role based access control (RBAC) rules for Anthos Service Mesh.
kubectl create clusterrolebinding cluster-admin-binding \ --clusterrole=cluster-admin \ --user="$(gcloud config get-value core/account)"
If you see the "cluster-admin-binding" already exists
error, you can safely
ignore it and continue with the existing cluster-admin-binding.
Downloading the installation file
Linux
Download the Anthos Service Mesh installation file to your current working directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-linux-amd64.tar.gz
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-linux-amd64.tar.gz.1.sig openssl dgst -verify /dev/stdin -signature istio-1.9.8-asm.6-linux-amd64.tar.gz.1.sig istio-1.9.8-asm.6-linux-amd64.tar.gz <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
.Extract the contents of the file to any location on your file system. For example, to extract the contents to the current working directory:
tar xzf istio-1.9.8-asm.6-linux-amd64.tar.gz
The command creates an installation directory in your current working directory named
istio-1.9.8-asm.6
that contains:- Sample applications in the
samples
directory. - The
istioctl
command-line tool that you use to install Anthos Service Mesh is in thebin
directory. - The Anthos Service Mesh configuration profiles are in the
manifests/profiles
directory.
- Sample applications in the
Ensure that you're in the Anthos Service Mesh installation's root directory.
cd istio-1.9.8-asm.6
Mac OS
Download the Anthos Service Mesh installation file to your current working directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-osx.tar.gz
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-osx.tar.gz.1.sig openssl dgst -sha256 -verify /dev/stdin -signature istio-1.9.8-asm.6-osx.tar.gz.1.sig istio-1.9.8-asm.6-osx.tar.gz <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
.Extract the contents of the file to any location on your file system. For example, to extract the contents to the current working directory:
tar xzf istio-1.9.8-asm.6-osx.tar.gz
The command creates an installation directory in your current working directory named
istio-1.9.8-asm.6
that contains:- Sample applications in the
samples
directory. - The
istioctl
command-line tool that you use to install Anthos Service Mesh is in thebin
directory. - The Anthos Service Mesh configuration profiles are in the
manifests/profiles
directory.
- Sample applications in the
Ensure that you're in the Anthos Service Mesh installation's root directory.
cd istio-1.9.8-asm.6
Windows
Download the Anthos Service Mesh installation file to your current working directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-win.zip
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.9.8-asm.6-win.zip.1.sig openssl dgst -verify - -signature istio-1.9.8-asm.6-win.zip.1.sig istio-1.9.8-asm.6-win.zip <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
.Extract the contents of the file to any location on your file system. For example, to extract the contents to the current working directory:
tar xzf istio-1.9.8-asm.6-win.zip
The command creates an installation directory in your current working directory named
istio-1.9.8-asm.6
that contains:- Sample applications in the
samples
directory. - The
istioctl
command-line tool that you use to install Anthos Service Mesh is in thebin
directory. - The Anthos Service Mesh configuration profiles are in the
manifests/profiles
directory.
- Sample applications in the
Ensure that you're in the Anthos Service Mesh installation's root directory.
cd istio-1.9.8-asm.6
Preparing resource configuration files
When you run the istioctl install
command, you specify
-f istio-operator.yaml
on the command line. This file contains information
about your project and cluster that Anthos Service Mesh requires. You need to download
a package that contains istio-operator.yaml
and other resource configuration
files so that you can set the project and cluster information.
To prepare the resource configuration files:
Mesh CA
Create a new directory for the Anthos Service Mesh package resource configuration files. We recommend that you use the cluster name as the directory name.
Change to the directory where you want to download the Anthos Service Mesh package.
Verify
kpt
version. Ensure you are running a pre 1.x version of kpt:kpt version
The output should be similar to the following:
0.39.2
If you have
kpt
version 1.x or higher, see Setting up your environment to download the required version for your operating system.Download the package:
kpt pkg get \ https://github.com/GoogleCloudPlatform/anthos-service-mesh-packages.git/asm@release-1.9-asm asm
Set the project ID for the project that the cluster was created in:
kpt cfg set asm gcloud.core.project ${PROJECT_ID}
Set the project number for the fleet host project:
kpt cfg set asm gcloud.project.environProjectNumber ${FLEET_PROJECT_NUMBER}
Set the cluster name:
kpt cfg set asm gcloud.container.cluster ${CLUSTER_NAME}
Set the default zone or region:
kpt cfg set asm gcloud.compute.location ${CLUSTER_LOCATION}
Set the tag to the version of Anthos Service Mesh that you are installing:
kpt cfg set asm anthos.servicemesh.tag 1.9.8-asm.6
Set the revision in Anthos Service Mesh package resource configuration files:
kpt cfg set asm anthos.servicemesh.rev asm-198-6
When you install Anthos Service Mesh, you set a revision label on
istiod
. You need to set the same revision on the validating webhook.Because the clusters in your multi-cluster configuration are in different projects, you need to configure the trust domain aliases for the other projects that will form the multi-cluster/multi-project service mesh.
Get the project ID of all clusters that will be in the multi-cluster/multi-project mesh.
For each cluster's project ID, set the trust domain aliases. For example, if you have clusters in 3 projects, run the following command and replace
PROJECT_ID_1
,PROJECT_ID_2
, andPROJECT_ID_3
with each cluster's project ID.kpt cfg set asm anthos.servicemesh.trustDomainAliases PROJECT_ID_1.svc.id.goog PROJECT_ID_2.svc.id.goog PROJECT_ID_3.svc.id.goog
As you configure the clusters in the other projects, you can use the same command.
The trust domain aliases enables Mesh CA to authenticate workloads on clusters in other projects. In addition to setting the trust domain aliases, after installing Anthos Service Mesh, you have to enable cross-cluster load balancing.
Output the values of the
kpt
setters:kpt cfg list-setters asm
The output of the command is similar to the following:
NAME VALUE anthos.servicemesh.canonicalServiceHub gcr.io/gke-release/asm/canonical-service-controller:1.9.8-asm.6 anthos.servicemesh.controlplane.monitoring.enabled true anthos.servicemesh.hub gcr.io/gke-release/asm anthos.servicemesh.hubMembershipID MEMBERSHIP_ID anthos.servicemesh.tag 1.9.8-asm.6 anthos.servicemesh.trustDomainAliases [example-project-12345.svc.id.goog,example-project-23456.svc.id.goog,example-project-98765.svc.id.goog] base-dir base gcloud.compute.location us-central gcloud.compute.network default gcloud.compute.subnetwork default gcloud.container.cluster example-cluster-1 gcloud.container.cluster.clusterSecondaryRange gcloud.container.cluster.releaseChannel REGULAR gcloud.container.cluster.servicesSecondaryRange gcloud.container.nodepool.max-nodes 4 gcloud.core.project example-project-12345 gcloud.project.environProjectID FLEET_PROJECT_ID gcloud.project.environProjectNumber 1234567890123 gcloud.project.projectNumber 9876543210987
Verify that the values for the following setters are correct:
- anthos.servicemesh.rev
- anthos.servicemesh.tag
- anthos.servicemesh.trustDomainAliases
- gcloud.compute.location
- gcloud.container.cluster
- gcloud.core.project
- gcloud.project.environProjectNumber
You can ignore the values for the other setters.
Istio CA
Create a new directory for the Anthos Service Mesh package resource configuration files. We recommend that you use the cluster name as the directory name.
Change to the directory where you want to download the Anthos Service Mesh package.
Verify
kpt
version. Ensure you are running a pre 1.x version of kpt:kpt version
The output should be similar to the following:
0.39.2
If you have
kpt
version 1.x or higher, download the required version:curl -L https://github.com/GoogleContainerTools/kpt/releases/download/v0.39.2/kpt_linux_amd64 > kpt_0_39_2 chmod +x kpt_0_39_2 alias kpt="$(readlink -f kpt_0_39_2)"
Download the package:
kpt pkg get \ https://github.com/GoogleCloudPlatform/anthos-service-mesh-packages.git/asm@release-1.9-asm asm
Set the project ID for the project that the cluster was created in:
kpt cfg set asm gcloud.core.project ${PROJECT_ID}
Set the project number for the fleet host project:
kpt cfg set asm gcloud.project.environProjectNumber ${FLEET_PROJECT_NUMBER}
Set the cluster name:
kpt cfg set asm gcloud.container.cluster ${CLUSTER_NAME}
Set the default zone or region:
kpt cfg set asm gcloud.compute.location ${CLUSTER_LOCATION}
Set the tag to the version of Anthos Service Mesh that you are installing:
kpt cfg set asm anthos.servicemesh.tag 1.9.8-asm.6
Set the revision in Anthos Service Mesh package resource configuration files:
kpt cfg set asm anthos.servicemesh.rev asm-198-6
Output the values of the
kpt
setters:kpt cfg list-setters asm
The output of the command is similar to the following:
NAME VALUE anthos.servicemesh.canonicalServiceHub gcr.io/gke-release/asm/canonical-service-controller:1.9.8-asm.6 anthos.servicemesh.controlplane.monitoring.enabled true anthos.servicemesh.hub gcr.io/gke-release/asm anthos.servicemesh.hubMembershipID MEMBERSHIP_ID anthos.servicemesh.tag 1.9.8-asm.6 anthos.servicemesh.trustDomainAliases base-dir base gcloud.compute.location us-central gcloud.compute.network default gcloud.compute.subnetwork default gcloud.container.cluster example-cluster-1 gcloud.container.cluster.clusterSecondaryRange gcloud.container.cluster.releaseChannel REGULAR gcloud.container.cluster.servicesSecondaryRange gcloud.container.nodepool.max-nodes 4 gcloud.core.project example-project-12345 gcloud.project.environProjectID FLEET_PROJECT_ID gcloud.project.environProjectNumber 1234567890123 gcloud.project.projectNumber 9876543210987
Verify that the values for the following setters are correct:
- anthos.servicemesh.rev
- anthos.servicemesh.tag
- gcloud.compute.location
- gcloud.container.cluster
- gcloud.core.project
- gcloud.project.environProjectNumber
You can ignore the values for the other setters.
Migrating to Anthos Service Mesh
Mesh CA
Verify that the current
kubeconfig
context is pointing to the cluster that you want to install Anthos Service Mesh on:kubectl config current-context
The output is in the following format:
gke_PROJECT_ID_CLUSTER_LOCATION_CLUSTER_NAME
The
kubeconfig
context and the values of thekpt
setters must match. If needed, run thegcloud container clusters get-credentials
command to set the currentkubeconfig
context.If needed, change to the
istio-1.9.8-asm.6
directory. Theistioctl
client is version dependent. Make sure that you use the version in theistio-1.9.8-asm.6/bin
directory.Run the following command to deploy the new control plane with the
asm-gcp-multiproject
profile. If you want to enable a supported optional feature, include-f
and the YAML filename on the following command line. See Enabling optional features for more information.bin/istioctl install \ -f asm/istio/istio-operator.yaml \ -f asm/istio/options/multiproject.yaml \ -f asm/istio/options/multicluster.yaml \ -f asm/istio/options/revisioned-istio-ingressgateway.yaml \ --revision=asm-198-6
The
--revision
argument adds a revision label in the formatistio.io/rev=asm-198-6
toistiod
. The revision label is used by the automatic sidecar injector webhook to associate injected sidecars with a particularistiod
revision. To enable sidecar auto-injection for a namespace, you must label it with a revision matching anistiod
Deployment.The following files override the settings in the
istio-operator.yaml
file:The
multiproject.yaml
file sets theasm-gcp-multiproject
profile.The
multicluster.yaml
file configures the settings that Anthos Service Mesh needs for a multi-cluster configuration.The
revisioned-istio-ingressgateway.yaml
file configures a revisioned Deployment for theistio-ingressgateway
.
Check that the control plane pods in
istio-system
are up:kubectl get pods -n istio-system
Example output:
NAME READY STATUS RESTARTS AGE istio-ingressgateway-c56675fcd-86zdn 1/1 Running 0 2m9s istio-ingressgateway-c56675fcd-vn4nv 1/1 Running 0 2m21s istiod-asm-198-6-6d5cfd4b89-xztlr 1/1 Running 0 3m44s istiod-fb7f746f4-wcntn 1/1 Running 0 50m
You have two control plane Deployments and Services running side-by-side.
Deploy the Canonical Service controller to your cluster:
kubectl apply -f asm/canonical-service/controller.yaml
The Canonical Service controller groups workloads belonging to the same logical service. For more information about Canonical Services, see the Canonical Service overview.
Istio CA
Verify that the current
kubeconfig
context is pointing to the cluster that you want to install Anthos Service Mesh on:kubectl config current-context
The output is in the following format:
gke_PROJECT_ID_CLUSTER_LOCATION_CLUSTER_NAME
The
kubeconfig
context and the values of thekpt
setters must match. If needed, run thegcloud container clusters get-credentials
command to set the currentkubeconfig
context.If needed, change to the
istio-1.9.8-asm.6
directory. Theistioctl
client is version dependent. Make sure that you use the version in theistio-1.9.8-asm.6/bin
directory.Run the following command to deploy the new control plane with the
asm-gcp-multiproject
profile. If you want to enable a supported optional feature, include-f
and the YAML filename on the following command line. See Enabling optional features for more information.bin/istioctl install \ -f asm/istio/istio-operator.yaml \ -f asm/istio/options/citadel-ca.yaml \ -f asm/istio/options/multiproject.yaml \ -f asm/istio/options/multicluster.yaml \ -f asm/istio/options/revisioned-istio-ingressgateway.yaml \ --revision=asm-198-6
The
--revision
argument adds a revision label in the formatistio.io/rev=asm-198-6
toistiod
. The revision label is used by the automatic sidecar injector webhook to associate injected sidecars with a particularistiod
revision. To enable sidecar auto-injection for a namespace, you must label it with a revision matching anistiod
Deployment.The following files override the settings in the
istio-operator.yaml
file:The
citadel-ca.yaml
configures Istio CA as the certificate authority.The
multiproject.yaml
file sets theasm-gcp-multiproject
profile.The
multicluster.yaml
file configures the settings that Anthos Service Mesh needs for a multi-cluster configuration.The
revisioned-istio-ingressgateway.yaml
file configures a revisioned Deployment for theistio-ingressgateway
.
Check that the control plane pods in
istio-system
are up:kubectl get pods -n istio-system
Example output:
NAME READY STATUS RESTARTS AGE istio-ingressgateway-c56675fcd-86zdn 1/1 Running 0 2m9s istio-ingressgateway-c56675fcd-vn4nv 1/1 Running 0 2m21s istiod-asm-198-6-6d5cfd4b89-xztlr 1/1 Running 0 3m44s istiod-fb7f746f4-wcntn 1/1 Running 0 50m
You have two control plane Deployments and Services running side-by-side.
Deploy the Canonical Service controller to your cluster:
kubectl apply -f asm/canonical-service/controller.yaml
The Canonical Service controller groups workloads belonging to the same logical service. For more information about Canonical Services, see the Canonical Service overview.
Deploying and redeploying workloads
Your installation isn't complete until you enable automatic sidecar proxy injection (auto-injection). Migrations from OSS Istio and upgrades follow the revision-based upgrade process (referred to as "canary upgrades" in the Istio documentation). With a revision-based upgrade, the new version of the control plane is installed alongside the existing control plane. You then move some of your workloads to the new version, which lets you monitor the effect of the upgrade with a small percentage of the workloads, before migrating all of the traffic to the new version.
When you ran istioctl install
, you set a
revision label in the
format istio.io/rev=asm-198-6
on istiod
. To enable auto-injection,
add a matching revision label to your namespace(s). The revision label is used
by the sidecar injector webhook to associate injected sidecars with a particular
istiod
revision. After adding the label, restart the Pods in the namespace for
sidecars to be injected.
If you included revisioned-istio-ingressgateway.yaml
when you ran istioctl
install
, a revisioned Deployment is configured for the istio-ingressgateway
.
This allows you to control when you switch to the new version.
Get the revision label that is on
istiod
and theistio-ingressgateway
.kubectl get pod -n istio-system -L istio.io/rev
The output from the command is similar to the following.
NAME READY STATUS RESTARTS AGE REV istio-ingressgateway-65d884685d-6hrdk 1/1 Running 0 67m istio-ingressgateway-65d884685d-94wgz 1/1 Running 0 67m istio-ingressgateway-asm-182-2-8b5fc8767-gk6hb 1/1 Running 0 5s asm-198-6 istio-ingressgateway-asm-182-2-8b5fc8767-hn4w2 1/1 Running 0 20s asm-198-6 istiod-asm-176-1-67998f4b55-lrzpz 1/1 Running 0 68m asm-186-8 istiod-asm-176-1-67998f4b55-r76kr 1/1 Running 0 68m asm-186-8 istiod-asm-182-2-5cd96f88f6-n7tj9 1/1 Running 0 27s asm-198-6 istiod-asm-182-2-5cd96f88f6-wm68b 1/1 Running 0 27s asm-198-6
Note whether you have both the old and new versions of the
istio-ingressgateway
.If you included the
revisioned-istio-ingressgateway
option when you upgraded, a canary upgrade of theistio-ingressgateway
was done. In this case, your output shows both the old and new versions of theistio-ingressgateway
.If you didn't include
revisioned-istio-ingressgateway
when you upgraded, an in-place upgrade of theistio-ingressgateway
was done. In this case, your output shows only the new version.
In the output, under the
REV
column, note the value of the revision label for the new version. In this example, the value isasm-198-6
.Also note the value in the revision label for the old
istiod
version. You need this to delete the old version ofistiod
when you finish moving workloads to the new version. In the example output, the value of the revision label for the old version isasm-186-8
.
If you have both the old and new versions of the
istio-ingressgateway
, switch theistio-ingressgateway
to the new revision. In the following command, changeREVISION
to the value that matches the revision label of the new version.kubectl patch service -n istio-system istio-ingressgateway --type='json' -p='[{"op": "replace", "path": "/spec/selector/service.istio.io~1canonical-revision", "value": "REVISION"}]'
Expected output:
service/istio-ingressgateway patched
Add the revision label to a namespace and remove the
istio-injection
label (if it exists). In the following command, changeREVISION
to the value that matches the new revision ofistiod
.kubectl label namespace NAMESPACE istio.io/rev=REVISION istio-injection- --overwrite
If you see
"istio-injection not found"
in the output, you can ignore it. That means that the namespace didn't previously have theistio-injection
label. Because auto-injection fails if a namespace has both theistio-injection
and the revision label, allkubectl label
commands in the Anthos Service Mesh documentation include removing theistio-injection
label.Restart the Pods to trigger re-injection.
kubectl rollout restart deployment -n NAMESPACE
Verify that your Pods are configured to point to the new version of
istiod
.kubectl get pods -n NAMESPACE -l istio.io/rev=REVISION
Test your application to verify that the workloads are working correctly.
If you have workloads in other namespaces, repeat the steps to label the namespace and restart Pods.
If you are satisfied that your application is working as expected, continue with the steps to transition to the new version of
istiod
. If there's an issue with your application, follow the steps to rollback.Run the following command again to confirm whether you have both the old and new versions of the
istio-ingressgateway
or only the new version. This determines how you handle transitioning to the new version of theistio-ingressgateway
or rolling back to the old version.kubectl get pod -n istio-system -L istio.io/rev
Complete the transition
If you are satisfied that your application is working as expected, remove the old control plane to complete the transition to the new version.
Change to the directory where the files from the
anthos-service-mesh
GitHub repository are located.Configure the validating webhook to use the new control plane.
kubectl apply -f asm/istio/istiod-service.yaml
If you have both the old and new versions of the
istio-ingressgateway
, delete the oldistio-ingressgateway
Deployment. The command that you run depends on whether you are migrating from Istio or upgrading from a previous version of Anthos Service Mesh:Migrate
If you migrated from Istio, the old
istio-ingressgateway
doesn't have a revision label.kubectl delete deploy/istio-ingressgateway -n istio-system
Upgrade
If you upgraded from a previous Anthos Service Mesh version, in the following command, replace
OLD_REVISION
with the revision label for the previous version of theistio-ingressgateway
.kubectl delete deploy -l app=istio-ingressgateway,istio.io/rev=OLD_REVISION -n istio-system --ignore-not-found=true
Delete the old version of
istiod
. The command that you use depends on whether you are migrating from Istio or upgrading from a previous version of Anthos Service Mesh.Migrate
If you migrated from Istio, the old
istiod
doesn't have a revision label.kubectl delete Service,Deployment,HorizontalPodAutoscaler,PodDisruptionBudget istiod -n istio-system --ignore-not-found=true
Upgrade
If you upgraded from a previous Anthos Service Mesh version, in the following command, make sure that
OLD_REVISION
matches the revision label for the previous version ofistiod
.kubectl delete Service,Deployment,HorizontalPodAutoscaler,PodDisruptionBudget istiod-OLD_REVISION -n istio-system --ignore-not-found=true
Remove the old version of the
IstioOperator
configuration.kubectl delete IstioOperator installed-state-OLD_REVISION -n istio-system
The expected output is similar to the following:
istiooperator.install.istio.io "installed-state-OLD_REVISION" deleted
Rollback
If you encountered an issue when testing your application with the new version of
istiod
, follow these steps to rollback to the previous version:Switch back to the old version of the
istio-ingressgateway
. The command that you use depends on whether you have both the old and new versions of theistio-ingressgateway
or only the new version.If you have both the old and new versions of the
istio-ingressgateway
run thekubectl patch service
command and replaceOLD_REVISION
with the old revision.kubectl patch service -n istio-system istio-ingressgateway --type='json' -p='[{"op": "replace", "path": "/spec/selector/service.istio.io~1canonical-revision", "value": "OLD_REVISION"}]'
If you only have the new version of the
istio-ingressgateway
, run thekubectl rollout undo
command.kubectl -n istio-system rollout undo deploy istio-ingressgateway
Relabel your namespace to enable auto-injection with the previous version of
istiod
. The command that you use depends on whether you used a revision label oristio-injection=enabled
with the previous version.If you used a revision label for auto-injection:
kubectl label namespace NAMESPACE istio.io/rev=OLD_REVISION --overwrite
If you used
istio-injection=enabled
:kubectl label namespace NAMESPACE istio.io/rev- istio-injection=enabled --overwrite
Expected output:
namespace/NAMESPACE labeled
Confirm that the revision label on the namespace matches the revision label on the previous version of
istiod
:kubectl get ns NAMESPACE --show-labels
Restart the Pods to trigger re-injection so the proxies have the previous version:
kubectl rollout restart deployment -n NAMESPACE
If you have both the old and new versions of the
istio-ingressgateway
, remove the newistio-ingressgateway
Deployment. Make sure that the value ofREVISION
in the following command is correct.kubectl delete deploy -l app=istio-ingressgateway,istio.io/rev=REVISION -n istio-system --ignore-not-found=true
Remove the new version of
istiod
. Make sure that the value ofREVISION
in the following command is correct.kubectl delete Service,Deployment,HorizontalPodAutoscaler,PodDisruptionBudget istiod-REVISION -n istio-system --ignore-not-found=true
Remove the new version of the
IstioOperator
configuration.kubectl delete IstioOperator installed-state-REVISION -n istio-system
Expected output is similar to the following:
istiooperator.install.istio.io "installed-state-REVISION" deleted
If you didn't include the
--disable_canonical_service
flag, the script enabled the Canonical Service controller. We recommend that you leave it enabled, but if you need to disable it, see Enabling and disabling the Canonical Service controller.