Version 1.8

Upgrading Anthos Service Mesh on premises

This guide explains how to upgrade Anthos Service Mesh from version 1.7.3+ or a 1.8 patch release to version 1.8.1 on Anthos clusters on VMware. Upgrades from earlier versions aren't supported. If you have an earlier version and you need to upgrade, see the following Anthos clusters on VMware upgrade guides:

When upgrading, we recommend that you do a revision-based upgrade (also referred to as a "canary upgrade") where both the new and previous versions of the control plane are running as you test the new version with a small percentage of your workloads. This approach is safer than an in-place upgrade, where the new version of the control plane replaces the previous version. Note that the istio-ingressgateway is upgraded in place, so you should plan for some disruption on your cluster.

Redeploying the Anthos Service Mesh control plane components takes about 5 to 10 minutes to complete. Additionally, you need to inject new sidecar proxies in all of your workloads so they are updated with the current Anthos Service Mesh version. The time it takes to update the sidecar proxies depends on many factors, such as the number of pods, the number of nodes, deployment scaling settings, pod disruption budgets, and other configuration settings. A rough estimate of the time that it takes to update the sidecar proxies is 100 pods per minute.

Preparing for the upgrade

If you customized the previous installation, you need the same customizations when you upgrade to Anthos Service Mesh. If you customized the installation by adding the --set values flag to istioctl install, we recommend that you add those settings to an IstioOperator YAML file (although you can continue to use the --set_values flag). To customize the installation, specify the -f flag with a YAML file when you run the istioctl install command.

Setting up your environment

You need the following tools on the machine you want to install Anthos Service Mesh from. Note that you can install Anthos Service Mesh only on a user cluster, not an admin cluster.

  • The curl command-line tool.
  • The Cloud SDK (the gcloud command-line tool).

After installing the Cloud SDK:

  1. Authenticate with the Cloud SDK:

    gcloud auth login
    
  2. Update the components:

    gcloud components update
    
  3. Install kubectl:

    gcloud components install kubectl
    
  4. If you want to deploy and test your installation with the Online Boutique sample application, install kpt:

    gcloud components install kpt
    
  5. Switch context to your user cluster:

    kubectl config use-context CLUSTER_NAME
  6. Grant cluster admin permissions to your user account (your Google Cloud login email address). 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=USER_ACCOUNT

Downloading the installation file

    Linux

  1. Download the Anthos Service Mesh installation file to your current working directory:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-linux-amd64.tar.gz
  2. Download the signature file and use openssl to verify the signature:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-linux-amd64.tar.gz.1.sig
    openssl dgst -verify /dev/stdin -signature istio-1.8.1-asm.5-linux-amd64.tar.gz.1.sig istio-1.8.1-asm.5-linux-amd64.tar.gz <<'EOF'
    -----BEGIN PUBLIC KEY-----
    MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ
    wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw==
    -----END PUBLIC KEY-----
    EOF

    The expected output is: Verified OK

  3. 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.8.1-asm.5-linux-amd64.tar.gz

    The command creates an installation directory in your current working directory named istio-1.8.1-asm.5 that contains:

    • Sample applications in the samples directory.
    • The istioctl command-line tool that you use to install Anthos Service Mesh is in the bin directory.
    • The Anthos Service Mesh configuration profiles are in the manifests/profiles directory.

  4. Mac OS

  5. Download the Anthos Service Mesh installation file to your current working directory:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-osx.tar.gz
  6. Download the signature file and use openssl to verify the signature:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-osx.tar.gz.1.sig
    openssl dgst -sha256 -verify /dev/stdin -signature istio-1.8.1-asm.5-osx.tar.gz.1.sig istio-1.8.1-asm.5-osx.tar.gz <<'EOF'
    -----BEGIN PUBLIC KEY-----
    MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ
    wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw==
    -----END PUBLIC KEY-----
    EOF

    The expected output is: Verified OK

  7. 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.8.1-asm.5-osx.tar.gz

    The command creates an installation directory in your current working directory named istio-1.8.1-asm.5 that contains:

    • Sample applications in the samples directory.
    • The istioctl command-line tool that you use to install Anthos Service Mesh is in the bin directory.
    • The Anthos Service Mesh configuration profiles are in the manifests/profiles directory.

  8. Windows

  9. Download the Anthos Service Mesh installation file to your current working directory:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-win.zip
  10. Download the signature file and use openssl to verify the signature:
    curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.8.1-asm.5-win.zip.1.sig
    openssl dgst -verify - -signature istio-1.8.1-asm.5-win.zip.1.sig istio-1.8.1-asm.5-win.zip <<'EOF'
    -----BEGIN PUBLIC KEY-----
    MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ
    wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw==
    -----END PUBLIC KEY-----
    EOF

    The expected output is: Verified OK

  11. 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.8.1-asm.5-win.zip

    The command creates an installation directory in your current working directory named istio-1.8.1-asm.5 that contains:

    • Sample applications in the samples directory.
    • The istioctl command-line tool that you use to install Anthos Service Mesh is in the bin directory.
    • The Anthos Service Mesh configuration profiles are in the manifests/profiles directory.

  12. Ensure that you're in the Anthos Service Mesh installation's root directory.
    cd istio-1.8.1-asm.5
  13. For convenience, add the tools in the /bin directory to your PATH:
    export PATH=$PWD/bin:$PATH

Upgrading Anthos Service Mesh

To install a new version of Anthos Service Mesh, we recommend that you follow the revision-based upgrade process (also referred to as a "canary upgrade"). With a revision-based upgrade, you install a new version of the control plane alongside the existing control plane. When installing the new version, you include a revision label that identifies the version of the new control plane. Each revision is a full Anthos Service Mesh control plane implementation with its own Deployment and Service.

You then migrate to the new version by setting the same revision label on your workloads to point to the new control plane and performing a rolling restart to re-inject the proxies with the new Anthos Service Mesh version. 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 version. This approach is much safer than doing an in-place upgrade where a new control plane replaces the previous version of the control plane.

Updating the control plane

Run the following command to deploy the new control plane. 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.

istioctl install \
  --set profile=asm-multicloud \
  --set revision=asm-181-5

The --set revision argument adds a istio.io/rev label to istiod. After running the command, you have two control plane Deployments and Services running side-by-side:

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-181-5-6d5cfd4b89-xztlr       1/1     Running   0          3m44s
istiod-fb7f746f4-wcntn                      1/1     Running   0          50m
promsd-579f9f9bf4-m65nc                     2/2     Running   1          50m

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 istiod is installed alongside the existing istiod. 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.

To enable auto-injection, you get the revision label that you used when you ran istioctl install and label your namespaces with the same revision label. The revision label is used by the sidecar injector webhook to associate injected sidecars with a particular istiod revision. After adding the label, any existing Pods in the namespace must be restarted for sidecars to be injected.

Enabling auto-injection

Follow these steps to enable auto-injection.

  1. Use the following command to locate the revision label on istiod:

    kubectl -n istio-system get pods -l app=istiod --show-labels
    

    The output from the command is similar to the following. Note that the output for migrations is slightly different than for upgrades. The following example output is from a migration.

    NAME                                READY   STATUS    RESTARTS   AGE   LABELS
    istiod-7744bc8dd7-qhlss             1/1     Running   0          49m   app=istiod,istio.io/rev=default,istio=pilot,pod-template-hash=7744bc8dd7
    istiod-asm-181-5-85d86774f7-flrt2   1/1     Running   0          26m   app=istiod,istio.io/rev=asm-181-5,istio=istiod,pod-template-hash=85d86774f7
    istiod-asm-181-5-85d86774f7-tcwtn   1/1     Running   0          26m   app=istiod,istio.io/rev=asm-181-5,istio=istiod,pod-template-hash=85d86774f7
    1. In the output, under the LABELS column, note the value in the istiod revision label for the new version, which follows the prefix istio.io/rev=. In this example, the value is asm-181-5.

    2. Also note the value in the revision label for the old istiod version. You need this to delete the old version of istiod when you finish moving workloads to the new version. In the example output, the value in the revision label for the old version of istiod is default.

  2. Add the revision label to a namespace and remove the istio-injection label (if it exists). In the following command, change REVISION to the value that matches the new revision of istiod.

    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 the istio-injection label. Because auto-injection fails if a namespace has both the istio-injection and the revision label, all kubectl label commands in the Anthos Service Mesh documentation include removing the istio-injection label.

  3. Restart the Pods to trigger re-injection.

    kubectl rollout restart deployment -n NAMESPACE
  4. Verify that your Pods are configured to point to the new version of istiod.

    kubectl get pods -n NAMESPACE -l istio.io/rev=REVISION
  5. Test your application to verify that the workloads are working correctly.

  6. If you have workloads in other namespaces, repeat the steps to label the namespace and restart Pods.

  7. If you are satisfied that your application is working as expected, continue with the steps to complete the transition to the new version of istiod. If there's an issue with your application, follow the steps to rollback.

    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.

    1. Delete the old version of istiod. In the following command, replace OLD_REVISION with the revision label for the previous version of istiod.

      istioctl x uninstall --revision OLD_REVISION
      

      The output from the command is similar to the following:

      Removed HorizontalPodAutoscaler:istio-system:istiod-OLD_REVISION.
      Removed PodDisruptionBudget:istio-system:istiod-OLD_REVISION.
      Removed Deployment:istio-system:istiod-OLD_REVISION.
      Removed Service:istio-system:istiod-OLD_REVISION.
      Removed ConfigMap:istio-system:istio-OLD_REVISION.
      Removed ConfigMap:istio-system:istio-sidecar-injector-OLD_REVISION.
      Removed EnvoyFilter:istio-system:metadata-exchange-1.6-OLD_REVISION.
      Removed EnvoyFilter:istio-system:metadata-exchange-1.7-OLD_REVISION.
      Removed EnvoyFilter:istio-system:stackdriver-filter-1.6-OLD_REVISION.
      Removed EnvoyFilter:istio-system:stackdriver-filter-1.7-OLD_REVISION.
      Removed EnvoyFilter:istio-system:tcp-metadata-exchange-1.6-OLD_REVISION.
      Removed EnvoyFilter:istio-system:tcp-metadata-exchange-1.7-OLD_REVISION.
      Removed EnvoyFilter:istio-system:tcp-stackdriver-filter-1.7-OLD_REVISION.
      Removed MutatingWebhookConfiguration::istio-sidecar-injector-OLD_REVISION.
      Removed ClusterRoleBinding::istiod-pilot-istio-system.
      ✔ Uninstall complete
    2. Remove the old version of the IstioOperator configuration.

      kubectl delete IstioOperator installed-state-OLD_REVISION -n istio-system
      

      The output from the command 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:

    1. 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 or istio-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
    2. Confirm that the revision label on the namespace matches the revision label on the previous version of istiod:

      kubectl get ns NAMESPACE --show-labels
      
    3. Restart the Pods to trigger re-injection so the proxies have the previous version:

      kubectl rollout restart deployment -n NAMESPACE
      
    4. Redeploy the previous version of the istio-ingressgateway:

      kubectl -n istio-system rollout undo deploy istio-ingressgateway
      

      Expected output on success:

      deployment.apps/istio-ingressgateway rolled back
    5. Remove the new version of istiod. Make sure that the value of REVISION in the following command is correct.

      kubectl delete Service,Deployment,HorizontalPodAutoscaler,PodDisruptionBudget istiod-REVISION -n istio-system --ignore-not-found=true
      
    6. Remove the new version of the IstioOperator configuration.

      kubectl delete IstioOperator installed-state-REVISION -n istio-system
      

      The expected output is similar to the following:

      istiooperator.install.istio.io "installed-state-REVISION" deleted

What's next