When you update fields in the spec
block of an Istio resource, Alibaba Cloud Service Mesh (ASM) records the resource
version before the update. ASM stores up to five latest versions. This topic describes
how to roll back a virtual service to an earlier version.
Prerequisites
- An ASM instance whose Istio version is v1.9.7.92-g1d820703-aliyun or later is created. For more information, see Create an ASM instance.
- A virtual service is created. For more information, see Manage virtual services.
Background information
Step 1: Enable the rollback feature for Istio resources
- Enable the rollback feature when you create an ASM instance. On the Create Service Mesh page, select Enable Istio custom resource version control to enable the rollback feature.
- Enable the rollback feature when you modify the configurations of an ASM instance. In the Settings Update panel, select Enable Istio custom resource version control to enable the rollback feature. In this example, enable the rollback feature by modifying the configurations of an ASM instance.
- Log on to the ASM console.
- In the left-side navigation pane, choose .
- On the Mesh Management page, find the ASM instance that you want to configure. Click the name of the ASM instance or click Manage in the Actions column.
- On the details page of the ASM instance, choose Settings. in the left-side navigation pane. On the Basic Information page, click
- In the Settings Update panel, select Enable Istio custom resource version control and click OK.
Step 2: Generate an earlier version of a virtual service
spec
block of the Istio resource are updated. If you update other fields of the Istio
resource, ASM does not record earlier versions.
- Log on to the ASM console.
- In the left-side navigation pane, choose .
- On the Mesh Management page, find the ASM instance that you want to configure. Click the name of the ASM instance or click Manage in the Actions column.
- On the details page of the ASM instance, choose in the left-side navigation pane.
- On the VirtualService page, find the virtual service that you want to manage and click YAML in the Actions column.
- In the Edit panel, modify a field in the
spec
block. For example, modify thenumber
field from 9080 to 9081. Then, click OK.
Step 3: Roll back the virtual service to an earlier version
In this example, roll back the virtual service to v2.
FAQ
What can I do if the Version button is not displayed for the Istio resource that I want to roll back?
Before you roll back an Istio resource to an earlier version, make sure that the version of your ASM instance is v1.9.7.92-g1d820703-aliyun or later and the rollback feature is enabled for Istio resources.
Does ASM record an earlier version of an Istio resource if I update the Istio resource by using a method other than the ASM console?
Yes. After the rollback feature is enabled for Istio resources, ASM records the earlier versions of Istio resources regardless of the methods that are used to update Istio resources.
Does ASM store an unlimited number of earlier versions of Istio resources?
No. ASM stores up to five latest versions of an Istio resource. If an Istio resource is modified more than five times, the earliest version is cleared.
Why are the earlier versions recorded by ASM not the same as the actual YAML content?
Redundant fields are omitted from the earlier versions recorded by ASM. This does
not affect the use of these earlier versions. For example, in the YAML content of
a gateway, the default value of the servers.tls
field in the spec
block is PASSTHROUGH
. If you set the servers.tls field to PASSTHROUGH again, ASM regards the field as
a redundant field and does not record the field in an earlier version.