Roll back an Istio resource

更新时间:
复制 MD 格式

When you update the spec field of an Istio resource, ASM records its version history, storing up to the five most recent versions. This topic uses a VirtualService as an example to show you how to roll back an Istio resource to a previous version.

Prerequisites

Background information

Istio resources include the resources under Traffic Management in the ASM console, such as VirtualService, destination rule, gateway, service entry, Envoy filter, workload group, workload entry, and Sidecar, and the resources under Zero Trust Security, such as request authentication policy, peer authentication policy, and authorization policy.

Step 1: Enable version history

You can enable the Istio resource version history feature in one of the following ways:

  • For a new ASM instance: Select Enable Istio custom resource version control when you create the ASM instance.

  • For an existing ASM instance: Enable the feature on the Basic Information page of the instance.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose ASM Instance > Base Information.

  3. On the Basic Information page, click Settings. In the Settings Update panel, select Enable Istio custom resource version control and then click OK.

Step 2: Generate a historical version

Important

ASM records a new historical version only when the spec field of an Istio resource is modified. Changes to other fields do not trigger version creation.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Traffic Management Center > VirtualService.

  3. On the Virtual Service page, click View YAML in the Actions column for the target VirtualService.

  4. In the Edit dialog box, modify the content in the spec field (for example, change the port's number from 9080 to 9081), and then click OK.

Step 3: Roll back the virtual service

This example shows how to roll back the target VirtualService to version v2.

  1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

  2. On the Mesh Management page, click the name of the ASM instance. In the left-side navigation pane, choose Traffic Management Center > VirtualService.

  3. On the Virtual Service page, click Version in the Actions column for the target VirtualService.

  4. In the Version dialog box, find the v2 version. Click View in the Actions column, and then click Rollback.

    To verify the rollback, return to the Virtual Service page and click View YAML in the Actions column for the target VirtualService. In the Edit dialog box, you can see that the YAML content has been restored to the v2 version.

FAQ

Why is the Version option missing?

To use the version rollback feature, ensure that your ASM instance is version 1.9.7.92 or later and that the Istio resource version history feature is enabled.

Is version history limited to console updates?

No. The version history feature is independent of how you perform updates. After the feature is enabled, ASM records historical versions for all updates to Istio resources.

Are there limitations on version history?

ASM stores up to the five most recent historical versions for each Istio resource. When you modify a resource for the sixth time, ASM automatically deletes the oldest version.

Why is the recorded YAML different?

ASM automatically omits redundant default values from the YAML file when it records a historical version. This optimization does not affect the behavior of the version when you restore it. For example, the default value of the servers.tls field in the spec of a gateway is PASSTHROUGH. If you explicitly set this field to PASSTHROUGH, ASM considers the setting redundant and does not include it in the version history.