ServiceEntry for External Services
What you'll learn: How to use Istio's ServiceEntry resource to register external services in the mesh and apply mesh policies to traffic leaving your cluster.
The Mesh Boundary Problem
By default, Istio's service mesh only knows about services running inside your Kubernetes cluster. But real applications often call external APIs—payment processors, third-party SaaS, legacy databases outside the mesh. Without telling Istio about these external dependencies, you lose visibility and control over that traffic.
What ServiceEntry Does
ServiceEntry is Istio's way of extending the service registry beyond your cluster boundaries. It declares external hosts (by DNS name or IP) as "known services" so Istio can:
- Route traffic to them intelligently
- Apply traffic policies (timeouts, retries, circuit breakers)
- Collect metrics and traces for external calls
- Enforce security policies like mTLS (where supported)
Think of it like adding an external contact to your phone's address book—suddenly you can apply rules, see call history, and manage that relationship just like internal contacts.
Basic Structure
A ServiceEntry specifies the external service's address, ports, and protocol:
apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: external-payment-api
spec:
hosts:
- api.payment-provider.com
ports:
- number: 443
name: https
protocol: HTTPS
location: MESH_EXTERNAL
resolution: DNS
Now traffic to api.payment-provider.com flows through Envoy proxies, where you can attach DestinationRule policies or VirtualService routing—just like internal services.
Key Takeaway:
ServiceEntry registers external services in Istio's service registry, enabling the mesh to manage, observe, and secure traffic to dependencies outside your cluster.