Discovery selectors in ambient mode
In ambient mode, the control plane includes workloads once it discovers them and the appropriate label enables traffic redirection through the ZTunnel proxy. By default, the control plane watches workloads across all namespaces in the cluster, which means every proxy receives configuration for every namespace — even for workloads that are not enrolled in the mesh.
In shared or multi-tenant clusters, restricting mesh participation to specific namespaces helps reduce configuration overhead and enables multiple service meshes to coexist on the same cluster. For details on discovery selectors, see Scoping the Service Mesh with discovery selectors.
Scoping the Service Mesh with discovery selectors
To restrict the scope of the service mesh in ambient mode, configure the discoverySelectors parameter within the meshConfig section of the Istio resource. This configuration controls which namespaces the control plane monitors based on label selectors.
Prerequisites
- An Istio control plane resource has been created.
- An IstioCNI resource has been created.
- A ZTunnel resource has been created.
Procedure
-
Label the namespace containing the IstioCNI resource (for example,
istio-cni): -
Label the namespace containing the Istio control plane resource (for example,
istio-system): -
Label the namespace containing the ZTunnel resource (for example,
ztunnel): -
Update the Istio control plane resource to include a
discoverySelectorssection with the matching label. Create a YAML file namedistio-discovery-selectors.yaml: -
Apply the configuration: