A Gateway in Istio is the entry and exit point between the service mesh and the outside world. Gateways are optional — if your workloads only communicate inside the mesh, you may not need one. For internal routing, a VirtualService alone is often sufficient. Gateways let you:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Expose services to external clients (Ingress Gateway).
- Control and centralize outbound traffic from the mesh (Egress Gateway).
- Perform TLS termination, protocol handling, and host/port binding at the mesh boundary.
- Use an Ingress Gateway to expose services to external users or APIs.
- Use an Egress Gateway to centralize outbound policies, logging, or TLS for traffic leaving the mesh.
- Skip Gateways if services are internal-only and no external exposure or control is required.
| Gateway Type | Purpose | Typical Use Case |
|---|---|---|
| Ingress Gateway | Manages incoming traffic to the mesh | Expose web services to the public (HTTP(S), gRPC) |
| Egress Gateway | Manages outgoing traffic from the mesh | Centralize outbound TLS, logging, or egress policies |

default, demo, minimal, remote, empty, preview, and ambient) include different core components. For example, the demo profile commonly includes both ingress and egress gateways, while minimal might include only ingress.

- kubectl get pods -n istio-system
Ensure the Gateway selector matches the label on the gateway pods. Common labels are
istio=ingressgateway or istio=egressgateway (labels vary by installation). If the selector is incorrect, the Gateway resource will not be bound to the gateway pods and external traffic will not be routed.

- Gateway — declares ports, protocols, hostnames to listen on and uses a selector to target gateway pods.
- VirtualService — defines routing rules (host, path, headers) and is how you bind Gateway traffic to services.
- DestinationRule — optional for basic routing but required for subsets, load balancing policies, connection pools, or TLS settings.
| Resource | Primary Responsibility | Required to expose service externally? |
|---|---|---|
| Gateway | Bind Envoy gateway pods to ports/protocols/hosts | Yes (for external traffic) |
| VirtualService | Route traffic to service destinations and define match rules | No (can work for internal-only) |
| DestinationRule | Configure subsets, LB, TLS for destinations | No (but needed for subsets/advanced features) |
- The
selectorabove targets ingress gateway pods in theistio-systemnamespace. If your installation used a different label (for exampleistio=ingress), change the selector accordingly. - For production, use port
443and HTTPS with propertlsserver settings.
app-svcallows internal service-to-service routing rules to match."app.example.com"applies the same routing for external requests coming through the Gateway.
- External client sends HTTP/HTTPS to the Ingress Gateway public IP (e.g.,
app.example.com). - The Ingress Gateway (Envoy) receives the request and optionally terminates TLS.
- Envoy uses the Gateway configuration to determine port/protocol handling.
- The request is matched by a VirtualService (host/path) to select routing.
- Traffic is forwarded to the Kubernetes Service and then to the target pods.
- The service responds and the response flows back to the client.

- A Gateway needs a corresponding VirtualService to route traffic into the mesh.
- A VirtualService can operate without a Gateway for internal routing.
- DestinationRules are optional for simple routing but required when using subsets, load balancing, or connection pool/TLS settings.
"*" in hosts permits outbound connections to any host (subject to additional mesh policies). Restrict outbound traffic by listing specific hostnames instead of "*" when required.
To force traffic through the egress gateway:
- Create a ServiceEntry (if the external host is not part of the mesh DNS) to allow mesh resolution/reachability.
- Create a VirtualService that references the egress Gateway (use
namespace/gateway-nameif in different namespaces).
api.example.com through the egress gateway:
- A workload’s sidecar Envoy intercepts outbound traffic.
- The VirtualService routing rules send matching outbound requests to the Egress Gateway.
- The Egress Gateway applies policies, logging, and TLS, then forwards the request to the external service.
- Responses return via the Egress Gateway back to the originating workload.

- TLS modes and
serverTLSSettings - Port and protocol definitions
- Host binding and redirects

Tip: Review the “Reference: Networking — Gateway” section in the Istio docs for examples on
tls settings, serverTLSSettings, and protocol handling: https://istio.io/latest/docs/reference/config/networking/gateway/. Understanding Gateway selectors, servers, and how VirtualService integrates with Gateways is key for deployment and certification exams.- What Istio Gateways are and when to use them.
- Differences between Ingress and Egress Gateways and how they integrate with VirtualService and DestinationRule.
- Example YAMLs for VirtualService, DestinationRule, Ingress Gateway, and Egress Gateway.
- High-level incoming and outgoing traffic flows and configuration considerations.
- Practice configuring a Gateway + VirtualService end-to-end.
- Test TLS termination and host/path-based routing.
- Explore ServiceEntry + Egress Gateway patterns for controlled outbound access.