Chapter 4. Istio ambient mode
Istio ambient mode introduces an architecture for Red Hat OpenShift Service Mesh without sidecar injection. This mode is designed to simplify operations and reduce resource usage. Instead of injecting a sidecar proxy into each application pod, ambient mode uses a shared node-level proxy for Layer 4 (L4) functionality and an optional, dedicated proxy for Layer 7 (L7) features.
Istio ambient mode is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
4.1. About Istio ambient mode Copy linkLink copied to clipboard!
To understand the Istio ambient mode architecture, see the following definitions:
- ZTunnel proxy
- A per-node proxy that manages secure, transparent Transmission Control Protocol (TCP) connections for all workloads on the node. It operates at Layer 4 (L4), offloading mutual Transport Layer Security (mTLS) and L4 policy enforcement from application pods.
- Waypoint proxy
- An optional proxy that runs per service account or namespace to provide advanced Layer 7 (L7) features such as traffic management, policy enforcement, and observability. You can apply L7 features selectively to avoid the overhead of sidecars for every service.
- Istio CNI plugin
- Redirects traffic to the Ztunnel proxy on each node, enabling transparent interception without requiring modifications to application pods.
Istio ambient mode offers the following benefits:
- Simplified operations that remove the need to manage sidecar injection, reducing the complexity of mesh adoption and operations.
-
Reduced resource consumption with a per-node Ztunnel proxy that provides L4 service mesh features and an optional
waypoint
proxy that reduces resource overhead per pod. Incremental adoption that enables workloads to join the mesh with the L4 features like mutual Transport Layer Security (mTLS) and basic policies with optional
waypoint
proxies added later to use L7 service mesh features, such as HTTP(L7) traffic management.NoteThe L7 features require deploying
waypoint
proxies, which introduces minimal additional overhead for the selected services.- Enhanced security that provides a secure, zero-trust network foundation with mTLS by default for all meshed workloads.
Ambient mode is a newer architecture and may involve different operational considerations than traditional sidecar models.
While well-defined discovery selectors allow a service mesh deployed in ambient mode alongside a mesh in sidecar mode, this scenario has not been thoroughly validated. To avoid potential conflicts, install Istio ambient mode only on clusters that do not have an existing Red Hat OpenShift Service Mesh installation. Ambient mode remains a Technology Preview feature.
Istio ambient mode is not compatible with clusters that use Red Hat OpenShift Service Mesh 2.6 or earlier. You must not install or use them together.
4.1.1. Installing Istio ambient mode Copy linkLink copied to clipboard!
You can install Istio ambient mode on OpenShift Container Platform 4.19 or later and Red Hat OpenShift Service Mesh 3.1.0 or later with the required Gateway API custom resource definitions (CRDs).
Prerequisites
- You have deployed a cluster on OpenShift Container Platform 4.19 or later.
- You have installed the OpenShift Service Mesh Operator 3.1.0 or later in the OpenShift Container Platform cluster.
-
You are logged in to the OpenShift Container Platform cluster either through the web console as a user with the
cluster-admin
role, or with theoc login
command, depending on the installation method. -
You have configured the OVN-Kubernetes Container Network Interface (CNI) to use local gateway mode by setting the
routingViaHost
field astrue
in thegatewayConfig
specification for the Cluster Network Operator. For more information, see "Configuring gateway mode".
Procedure
Install the Istio control plane:
Create the
istio-system
namespace by running the following command:oc create namespace istio-system
$ oc create namespace istio-system
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an
Istio
resource namedistio.yaml
similar to the following example:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantYou must set the
profile
field toambient
, and configure the.spec.values.pilot.trustedZtunnelNamespace
value to match the namespace where theZTunnel
resource will be installed.Apply the
Istio
custom resource (CR) by running the following command:oc apply -f istio.yaml
$ oc apply -f istio.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the Istio control plane to contain the
Ready
status condition by running the following command:oc wait --for=condition=Ready istios/default --timeout=3m
$ oc wait --for=condition=Ready istios/default --timeout=3m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the Istio Container Network Interface (CNI):
Create the
istio-cni
namespace by running the following command:oc create namespace istio-cni
$ oc create namespace istio-cni
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
IstioCNI
resource namedistio-cni.yaml
similar to the following example:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set the
profile
field toambient
.Apply the
IstioCNI
CR by running the following command:oc apply -f istio-cni.yaml
$ oc apply -f istio-cni.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the
IstioCNI
pods to contain theReady
status condition by running the following command:oc wait --for=condition=Ready istios/default --timeout=3m
$ oc wait --for=condition=Ready istios/default --timeout=3m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the Ztunnel proxy:
Create the
ztunnel
namespace for Ztunnel proxy by running the following command:oc create namespace ztunnel
$ oc create namespace ztunnel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The namespace name for
ztunnel
project must match thetrustedZtunnelNamespace
parameter in Istio configuration.Create the
Ztunnel
resource namedztunnel.yaml
similar to the following example:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
Ztunnel
CR by running the following command:oc apply -f ztunnel.yaml
$ oc apply -f ztunnel.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Wait for the
Ztunnel
pods to contain theReady
status condition by running the following command:oc wait --for=condition=Ready ztunnel/default --timeout=3m
$ oc wait --for=condition=Ready ztunnel/default --timeout=3m
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2. About discovery selectors and Istio ambient mode Copy linkLink copied to clipboard!
Istio ambient mode includes workloads when the control plane discovers each workload and the appropriate label enables traffic redirection through the Ztunnel proxy. By default, the control plane discovers workloads in all namespaces across the cluster. As a result, each proxy receives configuration for every namespace, including workloads that are not enrolled in the mesh. In shared or multi-tenant clusters, limiting mesh participation to specific namespaces helps reduce configuration overhead and supports multiple service meshes within the same cluster.
For more information on discovery selectors, see "Scoping the Service Mesh with discovery selectors".
4.2.1. Scoping the Service Mesh with discovery selectors in Istio ambient mode Copy linkLink copied to clipboard!
To limit the scope of the OpenShift Service Mesh in Istio ambient mode, you can configure discoverySelectors
parameter in the meshConfig
section of the Istio
resource. The configuration controls which namespaces the control plane discovers based on label selectors.
Prerequisites
- You have deployed a cluster on OpenShift Container Platform 4.19 or later.
-
You have created an
Istio
control plane resource. -
You have created an
IstioCNI
resource. -
You have created a
Ztunnel
resource.
Procedure
Add a label to the namespace containing the
Istio
control plane resource, for example, theistio-system
namespace, by running the following command:oc label namespace istio-system istio-discovery=enabled
$ oc label namespace istio-system istio-discovery=enabled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a label to the namespace containing the
IstioCNI
resource, for example, theistio-cni
namespace, by running the following command:oc label namespace istio-cni istio-discovery=enabled
$ oc label namespace istio-cni istio-discovery=enabled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add a label to the namespace containing the
Ztunnel
resource, for example, theztunnel
namespace, by running the following command:oc label namespace ztunnel istio-discovery=enabled
$ oc label namespace ztunnel istio-discovery=enabled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Modify the
Istio
control plane resource to include adiscoverySelectors
section with the same label:Create a YAML file with the name
istio-discovery-selectors.yaml
similar to the following example:Example configuration
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the YAML file to
Istio
control plane resource by running the following command:oc apply -f istio-discovery-selectors.yaml
$ oc apply -f istio-discovery-selectors.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.3. Deploying the Bookinfo application in Istio ambient mode Copy linkLink copied to clipboard!
You can deploy the bookinfo
sample application in Istio ambient mode without sidecar injection by using the ZTunnel
proxy. For more information on bookinfo
application, see "About the Bookinfo application".
Prerequisites
- You have deployed a cluster on OpenShift Container Platform 4.15 or later, which includes the supported Kubernetes Gateway API custom resource definitions (CRDs) required for Istio ambient mode.
-
You are logged in to the OpenShift Container Platform cluster either through the web console as a user with the
cluster-admin
role, or with theoc login
command, depending on the installation method. - You have installed the Red Hat OpenShift Service Mesh Operator, created the Istio resource, and the Operator has deployed Istio.
-
You have created an
IstioCNI
resource, and the Operator has deployed the necessaryIstioCNI
pods. -
You have created a
Ztunnel
resource, and the Operator has deployed the necessaryZtunnel
pods.
Procedure
Create the
bookinfo
namespace by running the following command:oc create namespace bookinfo
$ oc create namespace bookinfo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the
istio-discovery=enabled
label to thebookinfo
namespace by running the following command:oc label namespace bookinfo istio-discovery=enabled
$ oc label namespace bookinfo istio-discovery=enabled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
bookinfo
YAML file to deploy thebookinfo
application by running the following command:oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo.yaml
$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
bookinfo-versions
YAML file to deploy thebookinfo
application by running the following command:oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo-versions.yaml
$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo-versions.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
bookinfo
pods are running by entering the following command:oc -n bookinfo get pods
$ oc -n bookinfo get pods
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the
bookinfo
application is running by entering the following command:oc exec "$(oc get pod -l app=ratings -n bookinfo \ -o jsonpath='{.items[0].metadata.name}')" \ -c ratings -n bookinfo \ -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
$ oc exec "$(oc get pod -l app=ratings -n bookinfo \ -o jsonpath='{.items[0].metadata.name}')" \ -c ratings -n bookinfo \ -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the bookinfo application to the Istio ambient mesh by labeling either the entire namespace or the individual pods:
To include all workloads in the bookinfo namespace, apply the
istio.io/dataplane-mode=ambient
label to thebookinfo
namespace, by running the following command:oc label namespace bookinfo istio.io/dataplane-mode=ambient
$ oc label namespace bookinfo istio.io/dataplane-mode=ambient
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
To include only specific workloads, apply the
istio.io/dataplane-mode=ambient
label directly to individual pods. See the "Additional resources" section for more details on the labels used to add or exclude workloads in a mesh.
NoteAdding workloads to the ambient mesh does not require restarting or redeploying application pods. Unlike sidecar mode, the number of containers in each pod remains unchanged.
Confirm that Ztunnel proxy has successfully opened listening sockets in the pod network namespace by running the following command:
istioctl ztunnel-config workloads --namespace ztunnel
$ istioctl ztunnel-config workloads --namespace ztunnel
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow