MeshExternalService makes a destination outside the mesh into a resource the mesh understands.
A policy can name it in spec.to[].targetRef, a route can send traffic to it in backendRefs,
and the mesh can originate TLS to it, so an external API or database is governed by the same
timeouts, retries and circuit breakers as anything inside the mesh.
On Kubernetes, this resource is accepted only in the system namespace.
Traffic to a MeshExternalService always goes through a mesh-scoped zone egress
in the client’s zone. The client’s sidecar sends the request to the egress over mesh mTLS, and
the egress connects to the endpoints. This path requires the following:
- A zone egress for the mesh in the client’s zone, selected by an initialized
MeshIdentity. Without one, the destination has no endpoints. - A
MeshIdentitythat selects the client proxies. A client without an identity gets no route to the destination, and the request fails locally with a 503. - A
MeshTrafficPermissionon the egress that allows the caller. - The
MeshExternalServicein the client’sreachableBackends(thekuma.io/reachable-backendsannotation on Kubernetes). A proxy doesn’t get an outbound for a destination it doesn’t list, unless the control plane setsKUMA_DEFAULTS_RESTRICT_OUTBOUND=false.