Chapter 4. Istio ambient mode
Istio ambient mode provides a sidecar-less architecture for Red Hat OpenShift Service Mesh that reduces operational complexity and resource overhead by using node-level Layer 4 (L4) proxies and optional Layer 7 proxies.
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 proxy that reduces resource overhead per pod.
waypoint Incremental adoption that enables workloads to join the mesh with the L4 features like mutual Transport Layer Security (mTLS) and basic policies with optional
proxies added later to use L7 service mesh features, such as HTTP(L7) traffic management.waypointNoteThe L7 features require deploying
proxies, which introduces minimal additional overhead for the selected services.waypoint- 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 role, or with the
cluster-admincommand, depending on the installation method.oc login -
You have configured the OVN-Kubernetes Container Network Interface (CNI) to use local gateway mode by setting the field as
routingViaHostin thetruespecification for the Cluster Network Operator. For more information, see "Configuring gateway mode".gatewayConfig
Procedure
Install the Istio control plane:
Create the
namespace by running the following command:istio-system$ oc create namespace istio-systemCreate an
resource namedIstiosimilar to the following example:istio.yamlExample configuration
apiVersion: sailoperator.io/v1 kind: Istio metadata: name: default spec: namespace: istio-system profile: ambient values: pilot: trustedZtunnelNamespace: ztunnelImportantYou must set the
field toprofile, and configure theambientvalue to match the namespace where the.spec.values.pilot.trustedZtunnelNamespaceresource will be installed.ZTunnelApply the
custom resource (CR) by running the following command:Istio$ oc apply -f istio.yamlWait for the Istio control plane to contain the
status condition by running the following command:Ready$ oc wait --for=condition=Ready istios/default --timeout=3m
Install the Istio Container Network Interface (CNI):
Create the
namespace by running the following command:istio-cni$ oc create namespace istio-cniCreate the
resource namedIstioCNIsimilar to the following example:istio-cni.yamlExample configuration
apiVersion: sailoperator.io/v1 kind: IstioCNI metadata: name: default spec: namespace: istio-cni profile: ambientSet the
field toprofile.ambientApply the
CR by running the following command:IstioCNI$ oc apply -f istio-cni.yamlWait for the
pods to contain theIstioCNIstatus condition by running the following command:Ready$ oc wait --for=condition=Ready istios/default --timeout=3m
Install the Ztunnel proxy:
Create the
namespace for Ztunnel proxy by running the following command:ztunnel$ oc create namespace ztunnelThe namespace name for
project must match theztunnelparameter in Istio configuration.trustedZtunnelNamespaceCreate the
resource namedZtunnelsimilar to the following example:ztunnel.yamlExample configuration
apiVersion: sailoperator.io/v1alpha1 kind: ZTunnel metadata: name: default spec: namespace: ztunnel profile: ambientApply the
CR by running the following command:Ztunnel$ oc apply -f ztunnel.yamlWait for the
pods to contain theZtunnelstatus condition by running the following command:Ready$ oc wait --for=condition=Ready ztunnel/default --timeout=3m
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
meshConfig
Istio
Prerequisites
- You have deployed a cluster on OpenShift Container Platform 4.19 or later.
-
You have created an control plane resource.
Istio -
You have created an resource.
IstioCNI -
You have created a resource.
Ztunnel
Procedure
Add a label to the namespace containing the
control plane resource, for example, theIstionamespace, by running the following command:istio-system$ oc label namespace istio-system istio-discovery=enabledAdd a label to the namespace containing the
resource, for example, theIstioCNInamespace, by running the following command:istio-cni$ oc label namespace istio-cni istio-discovery=enabledAdd a label to the namespace containing the
resource, for example, theZtunnelnamespace, by running the following command:ztunnel$ oc label namespace ztunnel istio-discovery=enabledModify the
control plane resource to include aIstiosection with the same label:discoverySelectorsCreate a YAML file with the name
similar to the following example:istio-discovery-selectors.yamlExample configuration
apiVersion: sailoperator.io/v1 kind: Istio metadata: name: default spec: namespace: istio-system values: pilot: trustedZtunnelNamespace: ztunnel profile: ambient meshConfig: discoverySelectors: - matchLabels: istio-discovery: enabledApply the YAML file to
control plane resource by running the following command:Istio$ oc apply -f istio-discovery-selectors.yaml
4.3. Deploying the Bookinfo application in Istio ambient mode Copy linkLink copied to clipboard!
You can deploy the
bookinfo
ZTunnel
bookinfo
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 role, or with the
cluster-admincommand, depending on the installation method.oc login - You have installed the Red Hat OpenShift Service Mesh Operator, created the Istio resource, and the Operator has deployed Istio.
-
You have created an resource, and the Operator has deployed the necessary
IstioCNIpods.IstioCNI -
You have created a resource, and the Operator has deployed the necessary
Ztunnelpods.Ztunnel
Procedure
Create the
namespace by running the following command:bookinfo$ oc create namespace bookinfoAdd the
label to theistio-discovery=enablednamespace by running the following command:bookinfo$ oc label namespace bookinfo istio-discovery=enabledApply the
YAML file to deploy thebookinfoapplication by running the following command:bookinfo$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo.yamlApply the
YAML file to deploy thebookinfo-versionsapplication by running the following command:bookinfo$ oc apply -n bookinfo -f https://raw.githubusercontent.com/openshift-service-mesh/istio/release-1.26/samples/bookinfo/platform/kube/bookinfo-versions.yamlVerify that the
pods are running by entering the following command:bookinfo$ oc -n bookinfo get podsExample output
NAME READY STATUS RESTARTS AGE details-v1-54ffdd5947-8gk5h 1/1 Running 0 5m9s productpage-v1-d49bb79b4-cb9sl 1/1 Running 0 5m3s ratings-v1-856f65bcff-h6kkf 1/1 Running 0 5m7s reviews-v1-848b8749df-wl5br 1/1 Running 0 5m6s reviews-v2-5fdf9886c7-8xprg 1/1 Running 0 5m5s reviews-v3-bb6b8ddc7-bvcm5 1/1 Running 0 5m5sVerify that the
application is running by entering the following command:bookinfo$ 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>"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
label to theistio.io/dataplane-mode=ambientnamespace, by running the following command:bookinfo$ oc label namespace bookinfo istio.io/dataplane-mode=ambient-
To include only specific workloads, apply the 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.
istio.io/dataplane-mode=ambient
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 ztunnelExample output
NAMESPACE POD NAME ADDRESS NODE WAYPOINT PROTOCOL bookinfo details-v1-54ffdd5947-cflng 10.131.0.69 ip-10-0-47-239.ec2.internal None HBONE bookinfo productpage-v1-d49bb79b4-8sgwx 10.128.2.80 ip-10-0-24-198.ec2.internal None HBONE bookinfo ratings-v1-856f65bcff-c6ldn 10.131.0.70 ip-10-0-47-239.ec2.internal None HBONE bookinfo reviews-v1-848b8749df-45hfd 10.131.0.72 ip-10-0-47-239.ec2.internal None HBONE bookinfo reviews-v2-5fdf9886c7-mvwft 10.128.2.78 ip-10-0-24-198.ec2.internal None HBONE bookinfo reviews-v3-bb6b8ddc7-fl8q2 10.128.2.79 ip-10-0-24-198.ec2.internal None HBONE istio-cni istio-cni-node-7hwd2 10.0.61.108 ip-10-0-61-108.ec2.internal None TCP istio-cni istio-cni-node-bfqmb 10.0.30.129 ip-10-0-30-129.ec2.internal None TCP istio-cni istio-cni-node-cv8cw 10.0.75.71 ip-10-0-75-71.ec2.internal None TCP istio-cni istio-cni-node-hj9cz 10.0.47.239 ip-10-0-47-239.ec2.internal None TCP istio-cni istio-cni-node-p8wrg 10.0.24.198 ip-10-0-24-198.ec2.internal None TCP istio-system istiod-6bd6b8664b-r74js 10.131.0.80 ip-10-0-47-239.ec2.internal None TCP ztunnel ztunnel-2w5mj 10.128.2.61 ip-10-0-24-198.ec2.internal None TCP ztunnel ztunnel-6njq8 10.129.0.131 ip-10-0-75-71.ec2.internal None TCP ztunnel ztunnel-96j7k 10.130.0.146 ip-10-0-61-108.ec2.internal None TCP ztunnel ztunnel-98mrk 10.131.0.50 ip-10-0-47-239.ec2.internal None TCP ztunnel ztunnel-jqcxn 10.128.0.98 ip-10-0-30-129.ec2.internal None TCP