Istio with RevisionBased strategy and IstioRevisionTag
TOC
Installing Istio with RevisionBased strategy and IstioRevisionTag
You can install the Istio control plane, IstioRevisionTag resource, 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
-
Create a resource for
IstioRevisionTag. The example YAML below shows how to create one nameddefault:Example configuration
Ensure that the
targetReffield is pointing to the correctIstioresource. In the provided example, theIstioRevisionTagis configured to reference theIstioresource that has the namedefault. -
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
IstioRevisionTagresource using the following command:Example output
The
IN USEfield showsTruebecause both active workloads and thebookinfonamespace now reference the tag. -
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 and IstioRevisionTag
With the RevisionBased update strategy for Istio, an IstioRevisionTag resource can be used to tag a specific IstioRevision. This allows you to attach workloads to that revision without needing to modify the istio.io/rev label on namespaces or pods.
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 created an
IstioRevisionTagresource where thetargetReffield correctly points to the desiredIstioresource. - 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. - You have verified the
InUsefield of theIstioRevisionTagresource istrue.
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
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. -
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.