How openshift-service-mesh/ztunnel works
Ztunnel is a node-level data-plane proxy for ambient mesh. Its runtime brings up proxy, control-plane, DNS, metrics, and administrative services; workload and service state is populated from xDS and used to authorize and route intercepted traffic. In-pod workload management installs per-workload proxies, while identity and TLS provide workload certificates. The graph emphasizes these product stages and documented metrics capability. Edges are limited to README statements or SOURCE INDEX references; where wiring is not evidenced, the relationship is omitted rather than inferred.
Main entry points: app.rs Application runtime · proxy.rs Traffic proxy · state.rs Proxy state · proxyfactory.rs Proxy factory
Components 29
Runtime services
- Application runtime
src/app.rs - Runtime configuration
src/config.rs - Admin service
src/admin.rs - In-pod manager
src/inpod.rs - Workload proxy state
src/inpod/statemanager.rs - Workload manager
src/inpod/workloadmanager.rs
Control and state
- Proxy state
src/state.rs - Service registry
src/state/service.rs - Workload registry
src/state/workload.rs - xDS processing
src/xds.rs - xDS client
src/xds/client.rs
Traffic handling
- DNS proxy
src/dns/server.rs - DNS handler
src/dns/handler.rs - Traffic proxy
src/proxy.rs - Proxy factory
src/proxyfactory.rs - Connection manager
src/proxy/connection_manager.rs
Identity and security
- Authorization policy
src/rbac.rs - Certificate manager
src/identity/manager.rs - CA client
src/identity/caclient.rs - TLS and certificates
src/tls.rs - Certificate revocation
src/tls/revocation.rs
Operations and telemetry
- Metrics registry
src/metrics.rs - Metrics endpoint
src/metrics/server.rs - Readiness endpoint
src/readiness.rs - Graceful draining
src/drain.rs
Other components
- Mesh workloads
- xDS control plane
- Certificate authority
- DNS upstream
Connections 41
- Application runtime → Runtime configuration: loads config
src/app.rs - Application runtime → Admin service: starts service
src/app.rs - Application runtime → Metrics registry: starts metrics
src/app.rs - Application runtime → Traffic proxy: starts proxy
src/app.rs - Application runtime → Readiness endpoint: starts readiness
src/app.rs - Application runtime → DNS proxy: starts DNS
src/app.rs - Application runtime → xDS processing: starts xDS
src/app.rs - Application runtime → Proxy factory: starts factory
src/app.rs - Application runtime → Graceful draining: uses draining
src/app.rs - Application runtime → In-pod manager: starts manager
src/app.rs - Application runtime → Proxy state: uses state
src/app.rs - In-pod manager → Workload proxy state: manages state
src/inpod.rs - In-pod manager → Workload manager: starts manager
src/inpod.rs - Workload proxy state → Proxy factory: creates proxies
src/inpod/statemanager.rs - Workload manager → Workload proxy state: updates state
src/inpod/workloadmanager.rs - DNS proxy → DNS handler: routes requests
src/dns.rs - DNS proxy → Proxy state: reads state
src/dns/server.rs - DNS handler → DNS upstream: forwards queries
- Proxy factory → Traffic proxy: creates proxies
src/proxyfactory.rs - Proxy factory → Connection manager: configures manager
src/proxyfactory.rs - Traffic proxy → Proxy state: resolves destinations
src/proxy.rs - Traffic proxy → Service registry: looks up services
src/proxy.rs - Traffic proxy → Workload registry: looks up workloads
src/proxy.rs - Traffic proxy → Authorization policy: checks authorization
src/proxy.rs - Traffic proxy → Certificate manager: fetches certificates
src/proxy.rs - Traffic proxy → Connection manager: manages connections
src/proxy.rs - xDS processing → xDS client: runs client
src/xds.rs - xDS processing → Proxy state: updates state
src/xds.rs - xDS client → xDS control plane: streams updates
- Proxy state → Service registry: holds registry
src/state.rs - Proxy state → Workload registry: holds registry
src/state.rs - Certificate manager → CA client: requests certificates
src/identity/manager.rs - CA client → Certificate authority: requests signing
- Certificate manager → TLS and certificates: uses certificates
src/identity/manager.rs - Traffic proxy → TLS and certificates: secures connections
src/proxy.rs - Traffic proxy → Certificate revocation: checks revocation
src/proxy/h2/client.rs - Application runtime → Mesh workloads: serves traffic
- Metrics registry → Metrics endpoint: serves metrics
src/metrics.rs - Metrics endpoint → Graceful draining: supports draining
src/metrics/server.rs - Readiness endpoint → Graceful draining: checks shutdown
src/readiness/server.rs - Admin service → Graceful draining: supports draining