Istio with RevisionBased strategy
TOC
Installing Istio with RevisionBased strategy
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-cniandistio-systemnamespace by running the following command: -
Install the Istio CNI plugin with the desired version. The following example configuration creates an
IstioCNIresource named default in theistio-cninamespace: -
Deploy the Istio control plane using the
RevisionBasedupdate strategy. The following example configuration creates anIstioresource nameddefaultin theistio-systemnamespace:Example configuration
-
Get the
IstioRevisionname by running the following command:Example output
The
IstioRevisionname is in the format<istio_resource_name>-<version>. -
Set up the application workloads to execute in the cluster. For instance, you can deploy the
bookinfosample application into thebookinfonamespace.a. Generate the
bookinfonamespace with the command below:b. Apply a label to the
bookinfonamespace to activate automatic sidecar injection. Use the following command:c. Deploy the
bookinfoapplication pods into thebookinfonamespace by executing this command: -
Inspect the
Istioresource using the following command:Example output
The
IN USEfield shows1after you deploy the application. -
Confirm that the proxy version matches the control plane version by running the following command:
The
VERSIONcolumn should match the control plane version.Example output
Updating Istio control plane with RevisionBased strategy
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
- You are logged in to the Alauda Container Platform web console as cluster-admin.
- You have installed the Alauda Service Mesh v2 Operator, and deployed Istio.
- You have installed the Alauda Container Platform Networking for Multus plugin, and kube-ovn must be v4.1.5 or later.
- You have installed
istioctlon your local machine. - You have configured the Istio control plane to use the
RevisionBasedupdate strategy. In this example, theIstioresource nameddefaultis deployed in theistio-systemnamespace. - You have installed the Istio CNI plugin with the desired version. In this example, the
IstioCNIresource nameddefaultis deployed in theistio-cninamespace. - You have labeled the
bookinfonamespace to enable sidecar injection. - You have application workloads running in the cluster. In this example, the bookinfo application is deployed in the
bookinfonamespace.
Procedure
-
Change the version in the
Istioresource. For example, to update to Istio1.26.3, set the spec.version field tov1.26.3by 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
IstioandIstioRevisionresources are ready with the new revision.a. Confirm that
Istioresource is ready by running the following command:Example output
b. Confirm that
IstioRevisionresource 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
VERSIONcolumn should match the old control plane version. -
Move the workloads to the new control plane by updating the
istio.io/revlabel 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
VERSIONcolumn should match the new control plane version. -
Verify that the old control plane,
Istio, andIstioRevisionresources has been deleted.a. Verify that the old control plane has beend deleted by running the following command:
b. Verify that the
Istioresource has been deleted by running the following command:c. Verify that the
IstioRevisionresource 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.