Interview › Istio & Service Mesh
How do you enforce that all traffic leaving the mesh goes through an egress gateway?
Istio & Service Mesh · Intermediate level
Answer
To force outbound mesh traffic through an egress gateway, I combine Istio outbound traffic policy, ServiceEntry, VirtualService, DestinationRule, AuthorizationPolicy, and network controls. The mesh config routes allowed external hosts to the egress gateway, while firewall or NetworkPolicy blocks direct pod egress.
Technical explanation
Istio config alone is not enough if pods can directly reach the internet at the network layer.
ServiceEntry defines known external services; VirtualService sends that traffic through the egress gateway.
NetworkPolicy, cloud security groups, NAT rules, or firewall policy should allow outbound only from the egress gateway path.
Hands-on example
Implementation flow:
1. Set outboundTrafficPolicy to REGISTRY_ONLY if appropriate.
2. Create ServiceEntry for api.partner.com.
3. Route host through istio-egressgateway.
4. Allow only egress gateway subnet/security group to external firewall.
5. Test direct pod curl fails while routed egress succeeds.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Istio & Service Mesh interview questions
- Does the data plane keep working if the control plane goes down, and why?
- What is locality-aware load balancing, and why does it help latency and cost?
- How does Istio handle multi-cluster service discovery at a high level?
- What is the difference between a primary-remote and a multi-primary multi-cluster setup?
- How do you measure the performance impact of enabling Istio?
- What is the Kubernetes Gateway API, and how is Istio adopting it?
- How do Istio Gateways relate to the Kubernetes Gateway API?
- What is the difference between Istio and an API gateway?