In this lesson you’ll configure an Istio Ingress Gateway to expose the Bookinfo application. The steps covered: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.
- Verify Istio is installed and sidecar injection is enabled on the namespace.
- Deploy Bookinfo and confirm sidecar injection on pods.
- Create an internal-only VirtualService.
- Create a Gateway that selects the Istio ingress dataplane.
- Update the VirtualService to bind to the Gateway and test via curl.
- Explain differences between cloud clusters (LoadBalancer) and kubeadm-style labs (NodePort).
1. Verify Istio installation and namespace injection
- Check Istio control-plane / system pods:
- Confirm sidecar injection is enabled for the
defaultnamespace:
istio-injection=enabled is not present, enable injection with:
2. Deploy Bookinfo and confirm sidecar injection
Deploy Bookinfo using your usual method (the YAMLs are omitted here). After deploying, verify the pods show2/2 (application + Envoy sidecar) where sidecar injection applies:
1/2, check pod events and sidecar injection policies for the namespace.
3. Create an internal-only VirtualService
Start by creating a VirtualService that routes traffic for theproductpage service internally. Save this manifest as vs.yaml:
productpage service host but is not yet exposed through a Gateway.
4. Locate the ingress dataplane label for Gateway selector
Istio Gateways select the ingress dataplane (ingress pod) using pod labels. Inspect the ingress pod(s) inistio-system to find the label to use as the Gateway selector:
Labels: block. Example:
istio=ingress or app=istio-ingress) — you will use this value under spec.selector in the Gateway manifest.
5. Create an Istio Gateway
Create a Gateway manifest that selects the ingress dataplane label and listens on port 80. Save asgw.yaml in the same namespace as your VirtualService (here we use default):
productpage host.
6. Check Istio ingress Service type (Cluster behavior)
Istio’s ingress Service type varies by environment:| Service Type | How to target for curl / external tests |
|---|---|
LoadBalancer | Use the external IP/hostname in requests (no Host header required if DNS points to it). |
NodePort | Use nodeIP:nodePort (or node IP + NodePort). When targeting a NodePort for a Gateway with port 80 mapped to a NodePort, use the node IP and that NodePort. |
ClusterIP | Must curl from inside the cluster (e.g., using a temporary curl pod) and target the ClusterIP. |
7. Test the Gateway (initial behavior)
If you test now without updating the VirtualService, you may get a 404. Example (curl from inside the cluster to the ClusterIP):productpage. The Gateway receives traffic for book.info.com, but no VirtualService is bound to that host + gateway combination yet.
8. Update the VirtualService to bind to the Gateway
Editvs.yaml to include the external host and reference the Gateway. The updated manifest:
9. Re-test and validate a 200 response
Target the ingress address that is reachable from where you run curl. If you don’t have DNS forbook.info.com, continue using the Host header:
Example (from inside the cluster using the ClusterIP):
book.info.com to the external LoadBalancer hostname/IP, you can omit the Host header and call the DNS name directly.
Testing without a DNS record: pass the Host header to the ingress IP to emulate requests for the hostname (for example,
Host: book.info.com). On cloud clusters the ingress Service typically becomes a LoadBalancer with an external hostname—update DNS to point your host (e.g., book.info.com) to that external IP/hostname.10. Quick troubleshooting checklist
- Confirm the Gateway
spec.selectormatches an ingress pod label (e.g.,istio=ingress). - Ensure the VirtualService lists the external host (e.g.,
book.info.com) underspec.hosts. - Bind the VirtualService to the Gateway by adding
spec.gateways: - istio-gateway. - Verify the ingress Service type (
LoadBalancervsNodePortvsClusterIP) and use an accessible address for curl tests. - Inspect Envoy logs on the ingress pod for routing errors:
Summary
- Create a Gateway whose
selectormatches the ingress dataplane label (e.g.,istio=ingress). - Create or update a VirtualService to include the external host(s) and a reference to the Gateway.
- Test using curl with a
Hostheader when DNS is not configured, making sure you target an ingress address reachable from your client. - On cloud-managed clusters, Istio commonly provisions a
LoadBalancerfor the ingress Service; on kubeadm lab environments you may seeNodePortinstead.