Este conteúdo não está disponível no idioma selecionado.
Chapter 1. Updating OpenShift Service Mesh
The strategy you use to deploy a service mesh affects how you can update the mesh.
1.1. Understanding versioning Copiar o linkLink copiado para a área de transferência!
Red Hat OpenShift Service Mesh follows Semantic Versioning for all product releases. Semantic Versioning uses a three-part version number in the format X.Y.Z to communicate the nature of changes in each release.
- X (Major version)
- indicates significant updates that might include breaking changes, such as architectural shifts, API changes, or schema modifications.
- Y (Minor version)
- introduces new features and enhancements while maintaining backward compatibility.
- Z (Patch version or z-stream release)
- delivers critical bug fixes and security updates, such as Common Vulnerabilities and Exposures (CVEs) resolutions. Patch versions do not include new features.
1.2. Understanding Service Mesh and Istio versions Copiar o linkLink copiado para a área de transferência!
The most current OpenShift Service Mesh Operator version is 3.1.1. This version supports the features listed in the "Service Mesh 3.1.1 feature support tables". The OpenShift Service Mesh Operator includes additional Istio releases for upgrades but supports only the latest Istio version available for each Operator version. See the "Service Mesh version support tables" to identify the supported Istio version for each Operator release.
1.3. Understanding Operator updates and channels Copiar o linkLink copiado para a área de transferência!
The Operator Lifecycle Manager (OLM) manages Operators and their associated services by using channels to organize and distribute updates. Channels are a way to group related updates.
To ensure that your OpenShift Service Mesh stays current with the latest security patches, bug fixes, and software updates, keep the OpenShift Service Mesh Operator up to date. The upgrade process depends on the configured channel and approval strategy.
OLM provides the following channels for the OpenShift Service Mesh Operator:
- Stable channel: tracks the most recent version of the OpenShift Service Mesh 3 Operator and the latest supported version of Istio. This channel enables upgrades to new operator versions and corresponding Istio updates as soon as they are released. Use the stable channel to stay current with the latest features, bug fixes, and security updates.
-
Versioned channel: restricts updates to patch-level releases within a specific minor version. For example,
stable-3.0provides access to the latest3.1.1patch version. When a new patch release becomes available, you can upgrade the Operator to the newer patch version. To move to a newer minor release, you must manually switch to a different channel. You can use a versioned channel to maintain a consistent minor version while applying only patch updates.
You can find the update strategy field in the Install Operator section and under the sub-section update approval. The default value for the update strategy is Automatic.
1.3.1. About Operator update process Copiar o linkLink copiado para a área de transferência!
The OpenShift Service Mesh Operator will upgrade automatically to the latest available version based on the selected channel when the approval strategy field is set to Automatic (default). If the approval strategy field is set to Manual, Operator Lifecycle Manager (OLM) will generate an update request, which a cluster administrator must approve to update the Operator to the latest version.
The Operator update process does not automatically update the Istio control plane unless the Istio resource version is set to an alias (for example, vX.Y-latest) and the updateStrategy is set to InPlace. This triggers a control plane update when a new version is available in the Operator. By default, the Operator will not update the Istio control plane unless the Istio resource is updated with a new version.
1.4. About Istio update process Copiar o linkLink copiado para a área de transferência!
After updating the OpenShift Service Mesh Operator, update the Istio control plane to the latest supported version. The Istio resource configuration determines how the control plane upgrade is performed, including which steps require manual action and which are handled automatically.
The Istio resource configuration includes the following fields that are relevant to the upgrade process:
spec.version-
specifies the version of Istio to install. Use the format
vX.Y.Z, whereX.Y.Zis the desired Istio release. For example, set the field tov1.24.4to install Istio1.24.4. Alternatively, set the value to an alias such asvX.Y-latestto automatically install the latest supported patch version for the specified minor release. spec.updateStrategy-
defines the strategy for updating the Istio control plane. The available update strategies are
InPlaceandRevisionBased.
To enable automatic patch upgrades, set the approval strategy of the Operator to Automatic. When the Operator detects a new patch release and the version field uses the vX.Y-latest alias, the control plane is updated based on the configured updateStrategy type.
1.4.1. About Istio control plane update strategies Copiar o linkLink copiado para a área de transferência!
The update strategy affects how the update process is performed. The spec.updateStrategy field in the Istio resource configuration determines how the OpenShift Service Mesh Operator updates the Istio control plane. When the Operator detects a change in the spec.version field or identifies a new minor release with a configured vX.Y-latest alias, it initiates an upgrade procedure. For each mesh, you select one of two strategies:
-
InPlace -
RevisionBased
InPlace is the default strategy for updating OpenShift Service Mesh.
1.5. About InPlace strategy Copiar o linkLink copiado para a área de transferência!
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).
1.5.1. Selecting InPlace strategy Copiar o linkLink copiado para a área de transferência!
To select the InPlace strategy, set the spec.updateStrategy.type value in the Istio resource to InPlace.
Example specification to select InPlace update strategy
kind: Istio
spec:
updateStrategy:
type: InPlace
kind: Istio
spec:
updateStrategy:
type: InPlace
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.
Running the Istio resource in High Availability mode to minimize traffic disruptions requires additional property settings. For more information, see "About Istio High Availability".
1.5.2. Installing with InPlace update strategy Copiar o linkLink copiado para a área de transferência!
You can install the Istio control plane, Istio CNI, and the Bookinfo demo application using the Inplace update strategy.
You can skip this installation procedure if the cluster already includes an Istio deployment.
When using the InPlace strategy, the IstioRevision resource created by the OpenShift Service Mesh Operator always uses the same name as the Istio resource.
Procedure
Create the
istio-systemnamespace by running the following command:oc create ns istio-system
$ oc create ns istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Attach the workloads to a control plane deployed using the
InPlacestrategy:Label the namespace to automatically include all workloads by entering the following command:
oc label namespace <namespace_name> istio.io/rev=<revision_name>
$ oc label namespace <namespace_name> istio.io/rev=<revision_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the revision label to individual workloads by modifying the pod template in the
Deploymentresource. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
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.oc label namespace <namespace_name> istio-injection=enabled
$ oc label namespace <namespace_name> istio-injection=enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the Istio control plane using the
InPlaceupdate strategy. The following example configuration creates anIstioresource nameddefaultin theistio-systemnamespace:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Istio CNI plugin with the desired version. The following example configuration creates an
IstioCNIresource nameddefaultin theistio-cninamespace:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure application workloads to run in the cluster. The following example deploys the
bookinfoapplication in thebookinfonamespace.Create the
bookinfonamespace by running the following command:oc create ns bookinfo
$ oc create ns bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Label the
bookinfonamespace to enable sidecar injection by running the following command:oc label namespace bookinfo istio-injection=enabled
$ oc label namespace bookinfo istio-injection=enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
bookinfopods in thebookinfonamespace by running the following command:oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfo
$ oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Review the
Istioresource by running the following command:oc get istio -n istio-system
$ oc get istio -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default Healthy v1.24.3 115s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default Healthy v1.24.3 115sCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
IN USEfield shows1because both the namespace label and the injected proxies reference theIstioRevisionresource.
1.5.3. Updating Istio control plane with InPlace strategy Copiar o linkLink copiado para a área de transferência!
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 OpenShift Container Platform as a user with the
cluster-adminrole. - You have installed the Red Hat OpenShift Service Mesh 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
bookinfoapplication is deployed in thebookinfonamespace.
Procedure
Change the version in the
Istioresource. For example, to update to Istio1.24.4, set thespec.versionfield tov1.24.4by running the following command:oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'$ oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Version update in Istio CR
kind: Istio spec: version: v1.24.4 updateStrategy: type: InPlacekind: Istio spec: version: v1.24.4 updateStrategy: type: InPlaceCopy to Clipboard Copied! Toggle word wrap Toggle overflow The Service Mesh 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:
oc get istio
$ oc get istioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default Healthy v1.24.4 4m50s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default Healthy v1.24.4 4m50sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the application workloads so that the new version of the sidecar gets injected by running the following command:
oc rollout restart deployment -n bookinfo
$ oc rollout restart deployment -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the new version of the sidecar is running by entering the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The column
VERSIONshould match with the new control plane version.
1.6. About RevisionBased strategy Copiar o linkLink copiado para a área de transferência!
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.
1.6.1. Selecting RevisionBased strategy Copiar o linkLink copiado para a área de transferência!
To deploy Istio with the RevisionBased strategy, create the Istio resource with the following spec.updateStrategy value:
Example specification to select RevisionBased strategy
kind: Istio
spec:
version: v1.24.4
updateStrategy:
type: RevisionBased
kind: Istio
spec:
version: v1.24.4
updateStrategy:
type: RevisionBased
After you select the strategy for the Istio resource, the Operator creates a new IstioRevision resource with the name <istio_resource_name>-<version>.
1.6.2. Installing Istio with RevisionBased strategy Copiar o linkLink copiado para a área de transferência!
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-systemnamespace by running the following command:oc create ns istio-system
$ oc create ns istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the Istio control plane using the
RevisionBasedupdate strategy. The following example configuration creates anIstioresource nameddefaultin theistio-systemnamespace:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Istio CNI plugin with the desired version. The following example configuration creates an
IstioCNIresource nameddefaultin theistio-cninamespace:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the
IstioRevisionname by running the following command:oc get istiorevision -n istio-system
$ oc get istiorevision -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy False v1.24.3 3m4s
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy False v1.24.3 3m4sCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
IstioRevisionname is in the format<istio_resource_name>-<version>.Configure application workloads to run in the cluster. The following example deploys the
bookinfoapplication in thebookinfonamespace:Create the
bookinfonamespace by running the following command:oc create ns bookinfo
$ oc create ns bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Label the
bookinfonamespace to enable sidecar injection by running the following command:oc label namespace bookinfo istio.io/rev=<revision_name>
$ oc label namespace bookinfo istio.io/rev=<revision_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
bookinfopods in thebookinfonamespace by running the following command:oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfo
$ oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Review the
Istioresource by running the following command:oc get istio -n istio-system
$ oc get istio -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default-v1-24-3 Healthy v1.24.3 5m13s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 1 1 1 default-v1-24-3 Healthy v1.24.3 5m13sCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
IN USEfield shows1after you deploy the application.Confirm that the proxy version matches the control plane version by running the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
VERSIONcolumn should match the control plane version.Example output
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 5m31s
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 5m31sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6.3. Updating Istio control plane with RevisionBased strategy Copiar o linkLink copiado para a área de transferência!
When updating Istio using the RevisionBased strategy, you can upgrade by more than one minor version at a time. The Red Hat OpenShift Service Mesh 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 OpenShift Container Platform as a user with the
cluster-adminrole. -
You have installed the Red Hat OpenShift Service Mesh Operator 3, and deployed Istio with the
RevisionBasedstrategy. 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
bookinfoapplication is deployed in thebookinfonamespace. -
You have installed
istioctlon your local machine.
Procedure
Change the version in the
Istioresource. For example, to update to Istio1.24.4, set thespec.versionfield tov1.24.4by running the following command:oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'$ oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Version Update in Istio CR
kind: Istio spec: version: v1.24.4 updateStrategy: type: RevisionBasedkind: Istio spec: version: v1.24.4 updateStrategy: type: RevisionBasedCopy to Clipboard Copied! Toggle word wrap Toggle overflow The Service Mesh 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.Confirm that
Istioresource is ready by running the following command:oc get istio
$ oc get istioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 2 2 1 default-v1-2-4 Healthy v1.24.4 9m23s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 2 2 1 default-v1-2-4 Healthy v1.24.4 9m23sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that
IstioRevisionresource is ready by running the following command:oc get istiorevision
$ oc get istiorevisionCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 10m default-v1-24-4 Local True Healthy False v1.24.4 66s
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 10m default-v1-24-4 Local True Healthy False v1.24.4 66sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Confirm that there are two control plane pods running, one for each revision by running the following command:
oc get pods -n istio-system
$ oc get pods -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE istiod-default-v1-24-3-c98fd9675-r7bfw 1/1 Running 0 10m istiod-default-v1-24-4-7495cdc7bf-v8t4g 1/1 Running 0 113s
NAME READY STATUS RESTARTS AGE istiod-default-v1-24-3-c98fd9675-r7bfw 1/1 Running 0 10m istiod-default-v1-24-4-7495cdc7bf-v8t4g 1/1 Running 0 113sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the workload sidecars are still connected to the previous control plane by running the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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:oc label namespace bookinfo istio.io/rev=<new_revision_name> --overwrite
$ oc label namespace bookinfo istio.io/rev=<new_revision_name> --overwriteCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the application workloads so that the new version of the sidecar gets injected by running the following command:
oc rollout restart deployment -n bookinfo
$ oc rollout restart deployment -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the new version of the sidecar is running by entering the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
VERSIONcolumn should match the new control plane version.Verify that the old control plane,
Istio, andIstioRevisionresources has been deleted.Verify that the old control plane has beend deleted by running the following command:
oc get pods -n istio-system
$ oc get pods -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
Istioresource has been deleted by running the following command:oc get istio
$ oc get istioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
IstioRevisionresource has been deleted by running the following command:oc get istiorevision
$ oc get istiorevisionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The OpenShift Service Mesh 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.
1.6.4. Installing Istio with RevisionBased strategy and IstioRevisionTag Copiar o linkLink copiado para a área de transferência!
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-systemnamespace by running the following command:oc create ns istio-system
$ oc create ns istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Deploy the Istio control plane using the
RevisionBasedupdate strategy. The following example configuration creates anIstioresource nameddefaultin theistio-systemnamespace:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an
IstioRevisionTagresource. The following example configuration creates anIstioRevisionTagresource nameddefault:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
targetReffield points to the desiredIstioresource. In the example above, theIstioRevisionTagreferences theIstioresource nameddefault.Create the
istio-cninamespace by running the following command:oc create ns istion-cni
$ oc create ns istion-cniCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the Istio CNI plugin with the desired version. The following example configuration creates an
IstioCNIresource nameddefaultin theistio-cninamespace:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Configure application workloads to run in the cluster. The following example deploys the
bookinfoapplication in thebookinfonamespace.Create the
bookinfonamespace by running the following command:oc create ns bookinfo
$ oc create ns bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow Label the
bookinfonamespace to enable sidecar injection by running the following command:oc label namespace bookinfo istio-injection=enabled
$ oc label namespace bookinfo istio-injection=enabledCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
bookinfopods in thebookinfonamespace by running the following command:oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfo
$ oc apply -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Review the
IstioRevisionTagresource by running the following command:oc get istiorevisiontag
$ oc get istiorevisiontagCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME STATUS IN USE REVISION AGE default Healthy True default-v1-24-3 2m46s
NAME STATUS IN USE REVISION AGE default Healthy True default-v1-24-3 2m46sCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
VERSIONcolumn should match the control plane version.Example output
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 5m31s
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 5m31sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
1.6.5. Updating Istio control plane with RevisionBased strategy and IstioRevisionTag Copiar o linkLink copiado para a área de transferência!
When updating Istio using the RevisionBased strategy, you can create an IstioRevisionTag resource to tag a specific IstioRevision resource. You can use the IstioRevisionTag resource to attach workloads to a specific IstioRevision resource without modifying the istio.io/rev label on namespaces or pods.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-adminrole. -
You have installed the Red Hat OpenShift Service Mesh Operator 3, and deployed Istio with the
RevisionBasedstrategy. In this example, theIstioresource nameddefaultis deployed in theistio-systemnamespace. -
You have created an
IstioRevisionTagresource and thetargetReffield is referencing the desiredIstioresource. - You have installed the Istio CNI plugin with the desired version.
-
You have labeled the
bookinfonamespace to enable sidecar injection. -
You have application workloads running in the cluster. In this example, the
bookinfoapplication is deployed in thebookinfonamespace. -
You have installed
istioctlon your local machine. -
You have confirmed that the
InUsefield in theIstioRevisionTagresource is set totrue.
Procedure
Change the version in the
Istioresource. For example, to update to Istio1.24.4, set thespec.versionfield tov1.24.4by running the following command:oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'$ oc patch istio default --type='merge' -p '{"spec":{"version":"v1.24.4"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Version Update in Istio CR
kind: Istio spec: version: v1.24.4 updateStrategy: type: RevisionBasedkind: Istio spec: version: v1.24.4 updateStrategy: type: RevisionBasedCopy to Clipboard Copied! Toggle word wrap Toggle overflow The Service Mesh 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 the
Istio,IstioRevisionandIstioRevisionTagresources are ready with the new revision.Confirm that
Istioresource is ready by running the following command:oc get istio
$ oc get istioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 2 2 1 default-v1-24-3 Healthy v1.24.3 9m23s
NAME REVISIONS READY IN USE ACTIVE REVISION STATUS VERSION AGE default 2 2 1 default-v1-24-3 Healthy v1.24.3 9m23sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that
IstioRevisionresource is ready by running the following command:oc get istiorevision
$ oc get istiorevisionCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 10m default-v1-24-4 Local True Healthy True v1.24.4 66s
NAME TYPE READY STATUS IN USE VERSION AGE default-v1-24-3 Local True Healthy True v1.24.3 10m default-v1-24-4 Local True Healthy True v1.24.4 66sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that
IstioRevisionTagresource is ready by running the following command:oc get istiorevisiontag
$ oc get istiorevisiontagCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME STATUS IN USE REVISION AGE default Healthy True default-v1-24-4 10m44s
NAME STATUS IN USE REVISION AGE default Healthy True default-v1-24-4 10m44sCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Confirm that there are two control plane pods ready for each revision by running the following command:
oc get pods -n istio-system
$ oc get pods -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME READY STATUS RESTARTS AGE istiod-default-v1-24-3-c98fd9675-r7bfw 1/1 Running 0 10m istiod-default-v1-24-4-7495cdc7bf-v8t4g 1/1 Running 0 113s
NAME READY STATUS RESTARTS AGE istiod-default-v1-24-3-c98fd9675-r7bfw 1/1 Running 0 10m istiod-default-v1-24-4-7495cdc7bf-v8t4g 1/1 Running 0 113sCopy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the proxy sidecar version is the same by running the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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:
oc rollout restart deployment -n bookinfo
$ oc rollout restart deployment -n bookinfoCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the new version of the sidecar is running by entering the following command:
istioctl proxy-status
$ istioctl proxy-statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
VERSIONcolumn should match the new control plane version.Verify that the old control plane,
Istio, andIstioRevisionresources has been deleted.Verify that the old control plane has been deleted by running the following command:
oc get pods -n istio-system
$ oc get pods -n istio-systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
Istioresource has been deleted by running the following command:oc get istio
$ oc get istioCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
IstioRevisionresource has beend deleted by running the following command:oc get istiorevision
$ oc get istiorevisionCopy to Clipboard Copied! Toggle word wrap Toggle overflow
The OpenShift Service Mesh 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.
1.7. About the Istio CNI update process Copiar o linkLink copiado para a área de transferência!
The Istio Container Network Interface (CNI) update process uses in-place updates. When the IstioCNI resource changes, the daemonset automatically replaces the existing istio-cni-node pods with the specified version of the CNI plugin.
You can use the following field to manage version updates:
spec.version-
defines the CNI plugin version to install. Specify the value in the format
vX.Y.Z, whereX.Y.Zrepresents the desired version. For example, usev1.24.4to install the CNI plugin version1.24.4.
To update the CNI plugin, modify the spec.version field with the target version. The IstioCNI resource also includes a values field that exposes configuration options from the istio-cni chart.
1.7.1. Updating the Istio CNI resource version Copiar o linkLink copiado para a área de transferência!
You can update the Istio CNI resource version by changing the version in the resource. Then, the Service Mesh Operator deploys a new version of the CNI plugin that replaces the old version of the CNI plugin. The istio-cni-node pods automatically reconnect to the new CNI plugin.
Prerequisites
-
You are logged in to OpenShift Container Platform as a user with the
cluster-adminrole. - You installed the Red Hat OpenShift Service Mesh Operator and deployed Istio.
-
You installed the Istio CNI plugin with the desired version. In the following example, the
IstioCNIresource nameddefaultis deployed in theistio-cninamespace.
Procedure
Change the version in the
Istioresource. For example, to update to Istio1.24.4, set thespec.versionfield tov1.24.4by running the following command:oc patch istiocni default -n istio-cni --type='merge' -p '{"spec":{"version":"v1.24.4"}}'$ oc patch istiocni default -n istio-cni --type='merge' -p '{"spec":{"version":"v1.24.4"}}'Copy to Clipboard Copied! Toggle word wrap Toggle overflow Confirm that the new version of the CNI plugin is ready by running the following command:
oc get istiocni default
$ oc get istiocni defaultCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example Output
NAME READY STATUS VERSION AGE default True Healthy v1.24.4 91m
NAME READY STATUS VERSION AGE default True Healthy v1.24.4 91mCopy to Clipboard Copied! Toggle word wrap Toggle overflow