The RevisionBased
strategy runs two revisions of the control plane during an upgrade. This approach supports gradual workload migration from the old control plane to the new one, enabling canary upgrades. It also supports upgrades across more than one minor version.
The RevisionBased
strategy creates a new Istio control plane instance for each change to the spec.version
field. The existing control plane remains active until all workloads transition to the new instance. You can move the workloads to the new control plane by updating the istio.io/rev
labels or using the IstioRevisionTag
resource, followed by a restart.
Although the RevisionBased
strategy involves additional steps and requires multiple control plane instances to run concurrently during the upgrade, it allows for gradual migration of workloads. This approach enables validation of the updated control plane with a subset of workloads before migrating the rest, making it useful for large meshes with mission-critical workloads.
To deploy Istio with the RevisionBased
strategy, create the Istio
resource with the following spec.updateStrategy
value:
Example specification to select RevisionBased
strategy
After you select the strategy for the Istio resource, the Operator creates a new IstioRevision
resource with the name <istio_resource_name>-<version>
.
You can install the Istio control plane, Istio CNI, and the Bookinfo demo application using the RevisionBased
update strategy.
You can use the following section to understand the update process. You can skip this installation if the cluster already includes an Istio deployment.
Procedure
Create the istio-system
namespace by running the following command:
Deploy the Istio control plane using the RevisionBased
update strategy. The following example configuration creates an Istio
resource named default
in the istio-system
namespace:
Example configuration
Install the Istio CNI plugin with the desired version. The following example configuration creates an IstioCNI
resource named default in the istio-cni
namespace:
Get the IstioRevision
name by running the following command:
Example output
When updating Istio using the RevisionBased
strategy, you can upgrade by more than one minor version at a time. The Alauda Service Mesh v2 Operator creates a new IstioRevision
resource for each change to the .spec.version
field and deploys a corresponding control plane instance. To migrate workloads to the new control plane, set the istio.io/rev
label on the namespace to match the name of the IstioRevision
resource, and then restart the workloads.
Prerequisites
istioctl
on your local machine.RevisionBased
update strategy. In this example, the Istio
resource named default
is deployed in the istio-system
namespace.IstioCNI
resource named default
is deployed in the istio-cni
namespace.bookinfo
namespace to enable sidecar injection.bookinfo
namespace.Procedure
Change the version in the Istio
resource. For example, to update to Istio 1.26.3
, set the spec.version field to v1.26.3
by running the following command:
Version update in Istio CR
The Service Mesh v2 Operator deploys a new version of the control plane alongside the old version of the control plane. The sidecars remain connected to the old control plane.
Confirm that both Istio
and IstioRevision
resources are ready with the new revision.
Confirm that Istio
resource is ready by running the following command:
Example output
Confirm that IstioRevision
resource is ready by running the following command:
Example output
Confirm that there are two control plane pods running, one for each revision by running the following command:
Example output
Confirm that the workload sidecars are still connected to the previous control plane by running the following command:
Example output
The VERSION
column should match the old control plane version.
Move the workloads to the new control plane by updating the istio.io/rev
label on the application namespace or pods to the revision name. For example, update the label for the entire namespace by running the following command:
Restart the application workloads so that the new version of the sidecar gets injected by running the following command:
Verification
Verify that the new version of the sidecar is running by entering the following command:
The VERSION
column should match the new control plane version.
Verify that the old control plane, Istio
, and IstioRevision
resources has been deleted.
Istio
resource has been deleted by running the following command:
IstioRevision
resource has been deleted by running the following command:
The Alauda Service Mesh v2 Operator deletes the old IstioRevision
resource and the associated control plane after the grace period defined in the spec.updateStrategy.inactiveRevisionDeletionGracePeriodSeconds
field expires. The default grace period is 30
seconds.
You can increase the grace period to allow sufficient time to test the new control plane before removing the previous revision. Set a higher value during canary upgrades to ensure workload stability before fully transitioning.