Identifying the revision name
The label required to enable sidecar injection is determined by the specific control plane instance, known as a revision.
Each revision is managed by corresponding IstioRevision resource, which is automatically managed by the Istio resource.
The naming convention for an IstioRevision is based on the spec.updateStrategy.type setting in the Istio resource:
InPlace: The revision shares the same name as the parentIstioresource.RevisionBased: The revision is named using the format<istio-resource-name>-v<version>.
Typically, each Istio resource corresponds to a single IstioRevision.
However, during a revision-based upgrade, multiple IstioRevision resources may exist, each representing a distinct control plane.
To list available revisions, use the following command:
For example output:
TOC
Enabling sidecar injection with default revision
When the name of IstioRevision is default, you can use the following labels on a namespace or a pod to enable sidecar injection:
You can also enable injection by applying the istio.io/rev: default label to the namespace or pod.
Enabling sidecar injection with other revisions
When then name of IstioRevision is not default, you'll need to use the specific IstioRevision name with the istio.io/rev label.
This links the pod to the desired control plane and enables sidecar injection.
For instance, using the example revision default-v1-28-1 from above, the following labels would enable sidecar injection:
When both istio-injection and istio.io/rev labels are applied, the istio-injection label takes precedence and treats the namespace as part of the default revision.
The injector is configured with the following logic:
- If either label (
istio-injectionorsidecar.istio.io/inject) is disabled, the pod is not injected. - If either label (
istio-injectionorsidecar.istio.io/injectoristio.io/rev) is enabled, the pod is injected.