Updating with InPlace strategy
The InPlace update strategy runs only one revision of the control plane at a time. During an update, all the workloads immediately connect to the new control plane version. To maintain compatibility between the sidecars and the control plane, you can upgrade only one minor version at a time.
The InPlace strategy updates and restarts the existing Istio control plane in place. During this process, only one instance of the control plane exists, eliminating the need to move workloads to a new control plane instance. To complete the update, restart the application workloads and gateways to refresh the Envoy proxies.
While the InPlace strategy offers simplicity and efficiency, there's a slight possibility of application traffic interruption if a workload pod updates, restarts, or scales while the control plane is restarting. You can mitigate this risk by running multiple replicas of the Istio control plane (istiod).
TOC
Selecting InPlace strategy
To select the InPlace strategy, set the spec.updateStrategy.type value in the Istio resource to InPlace.
Example specification to select InPlace update strategy
You can set this value while creating the resource or edit it later. If you edit the resource after creation, make the change before updating the Istio control plane.
Installing with InPlace update strategy
You can install the Istio control plane, Istio CNI, and the Bookinfo demo application using the InPlace 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: -
Attach the workloads to a control plane deployed using the
InPlacestrategy:-
Label the namespace to automatically include all workloads by entering the following command:
-
Apply the revision label to individual workloads by modifying the pod template in the
Deploymentresource. For example:
-
-
If the revision name is
default, attach the workloads to the revision by running the following command. The following example labels the namespace withistio-injection: enabledlabel. -
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
InPlaceupdate strategy. The following example configuration creates anIstioresource nameddefaultin theistio-systemnamespace:Example configuration
-
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
A value of
1in theIN USEcolumn signifies that theIstioRevisionresource is referenced by both the label on the namespace and the injected sidecar proxies.
Updating Istio control plane with InPlace strategy
When updating Istio using the InPlace strategy, you can increment the version by only one minor release at a time. To update by more than one minor version, you must increment the version and restart the workloads after each update. Restarting workloads ensures compatibility between the sidecar and control plane versions. The update process is complete after restarting all workloads.
Prerequisites
- You are logged in to the Alauda Container Platform web console as cluster-admin.
- You have installed the Alauda Container Platform Networking for Multus plugin, and kube-ovn must be v4.1.5 or later.
- You have installed the Alauda Service Mesh v2 Operator, and deployed Istio.
- You have installed
istioctlon your local machine. - You have configured the Istio control plane to use the
InPlaceupdate 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.28.1, set the spec.version field tov1.28.1by running the following command:Version update in Istio CR
The Service Mesh v2 Operator deploys a new version of the control plane that replaces the old version of the control plane. The sidecars automatically reconnect to the new control plane.
-
Confirm that the new version of the control plane is ready by running the following command:
Example output
-
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:
Example output
The column VERSION should match with the new control plane version.