Skip to main content
In this lesson we will configure an Ingress Gateway for the Bookinfo application using Istio. We’ll:
  • Verify Istio is installed and sidecar injection is enabled for the default namespace.
  • Deploy Bookinfo and create an internal VirtualService.
  • Create a Gateway resource and update the VirtualService to route external traffic.
  • Test access through the Gateway.
  • Show how a cloud installation exposes a LoadBalancer for external access.
Verify Istio is installed and the Istio system pods are running:
Example output:
Confirm that the default namespace has Istio sidecar injection enabled:
Example output:
Deploy the Bookinfo application (assumed already installed in these steps). Verify Bookinfo pods are running and have two containers (application + sidecar):
Example output:
Create an internal VirtualService that routes traffic to the productpage service. Save this as vs.yaml:
Apply it:
At this point the VirtualService works for internal cluster traffic using the host productpage. To expose Bookinfo externally we need a Gateway and then update the VirtualService to reference that Gateway and the external host header. First, identify the label used by the Istio ingress pod so the Gateway selects the correct ingress proxy. Describe the ingress pod (replace the pod name with yours if different):
Look at the Labels section. Example labels you may see:
Make sure your Gateway’s selector uses the exact label key/value present on your ingress pods (for example istio=ingress or app=istio-ingress). If the selector doesn’t match, the Gateway will not bind to the ingress proxy.
Create the Gateway in the default namespace (so it pairs with the VirtualService). Save this as gw.yaml:
Apply the Gateway:
Now update the VirtualService (vs.yaml) so it can be invoked via the external host book.info.com and is bound to the Gateway:
Apply the updated VirtualService:
Determine how the ingress is exposed. In some lab environments (kubeadm) Istio’s ingress service is a NodePort; in cloud environments it will usually be a LoadBalancer. Inspect the Istio services:
Note: different Istio installs may use slightly different resource names (for example some use istio-ingress while others use istio-ingressgateway). Use the service name you have in your cluster when determining access details. Example (kubeadm lab with NodePort):
Testing the Gateway
  • From within the cluster or a node that can reach ClusterIP, you can curl the ClusterIP directly and set the Host header to book.info.com.
  • From outside the cluster when using NodePort, use node-ip:nodePort.
  • From outside the cluster when using LoadBalancer, use the EXTERNAL-IP (or hostname) provided.
Example curl from a node that can reach the ClusterIP (replace IP with your istio-ingress CLUSTER-IP):
If the VirtualService is still only configured for productpage and not the external host, you’ll see a 404 Not Found. After updating the VirtualService to include the host and gateway, retry:
Expected response (after configuration):
Once configured correctly, requests whose Host header matches book.info.com will be accepted by the Gateway on port 80 and routed via the VirtualService to the productpage service.
If you are testing from a machine outside the cluster without DNS for book.info.com, pass the Host header with curl (as above) or add a local /etc/hosts entry pointing book.info.com to the load balancer or node IP for convenient testing.
Cloud example: LoadBalancer behavior If Istio is installed on a cloud provider (EKS, AKS, GKE), the istio-ingressgateway service typically becomes a LoadBalancer with an external IP/hostname. Example after installing Istio in a cloud cluster:
Example output (LoadBalancer in EKS/AWS):
You can point a DNS record (e.g., book.info.com) to the LoadBalancer’s external hostname/IP and then simply curl http://book.info.com without manually sending the Host header. Summary
  • Create a VirtualService for the internal service.
  • Create a Gateway that selects the Istio ingress pod using the correct label.
  • Update the VirtualService to include the external host and reference the Gateway (via gateways).
  • Test using the appropriate endpoint (ClusterIP for in-cluster tests, nodeIP:nodePort for NodePort from outside, or external LoadBalancer IP/hostname for cloud installations).
Thank you.

Watch Video

Practice Lab