Enabling sidecar injection with IstioRevisionTag resource
If your revision name is not default, you can still use the istio-injection=enabled label. To do so, you must first create an IstioRevisionTag resource named default that points to your Istio resource.
Reference
- IstioRevisionTag resource (Sail Operator documentation)
Prerequisites
- The Alauda Service Mesh v2 Operator has been installed, an
Istioresource is created, and Istio has been deployed by the Operator. - An
IstioCNIresource has been created, and the requiredIstioCNIpods are deployed by the Operator. - The namespaces intended to be part of the mesh exist and can be discovered by the Istio control plane.
- Optional: Workloads for the mesh are already deployed. In these examples, the Bookinfo application exists in the
bookinfonamespace, but sidecar injection (as described in step 2) is not yet configured. Refer to "Deploying the Bookinfo application" for further information.
Procedure
-
To find the name of your
Istioresource, execute the following command:Example output
In this case, the
Istioresource is nameddefault, but its underlying revision isdefault-v1-28-3. -
Define the
IstioRevisionTagresource in a YAML file:Example
IstioRevisionTagResource YAML -
Apply the
IstioRevisionTagresource using this command: -
Confirm the successful creation of the
IstioRevisionTagresource with the following command:Example output
As shown in the example, the new tag now references your active revision,
default-v1-28-3. Now you can use theistio-injection=enabledlabel as if your revision was calleddefault. -
Check that the pods are running without sidecars by executing the command below. All existing workloads in the target namespace should display
1/1in theREADYcontainers column.Example output
-
Add the injection label to the
bookinfonamespace with the following command:Example output
-
To activate sidecar injection, trigger a redeployment of the workloads in the
bookinfonamespace by running this command:
Verification
-
Check the rollout's success by running the command below and confirming that the newly created pods show
2/2containers in theREADYcolumn:Example output