Deploy the application

To explore Istio, you will install the sample Bookinfo application, composed of four separate microservices used to demonstrate various Istio features.

Istio's Bookinfo sample application is written in many different languages
Istio’s Bookinfo sample application is written in many different languages

As part of this guide, you’ll deploy the Bookinfo application and expose the productpage service using an ingress gateway.

Deploy the Bookinfo application

Start by deploying the application:

  1. $ kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo.yaml
  2. $ kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/bookinfo/platform/kube/bookinfo-versions.yaml

To verify that the application is running, check the status of the pods:

  1. $ kubectl get pods
  2. NAME READY STATUS RESTARTS AGE
  3. details-v1-cf74bb974-nw94k 1/1 Running 0 42s
  4. productpage-v1-87d54dd59-wl7qf 1/1 Running 0 42s
  5. ratings-v1-7c4bbf97db-rwkw5 1/1 Running 0 42s
  6. reviews-v1-5fd6d4f8f8-66j45 1/1 Running 0 42s
  7. reviews-v2-6f9b55c5db-6ts96 1/1 Running 0 42s
  8. reviews-v3-7d99fd7978-dm6mx 1/1 Running 0 42s

To access the productpage service from outside the cluster, you need to configure an ingress gateway.

Deploy and configure the ingress gateway

You will use the Kubernetes Gateway API to deploy a gateway called bookinfo-gateway:

  1. $ kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.24/samples/bookinfo/gateway-api/bookinfo-gateway.yaml

By default, Istio creates a LoadBalancer service for a gateway. As we will access this gateway by a tunnel, we don’t need a load balancer. Change the service type to ClusterIP by annotating the gateway:

  1. $ kubectl annotate gateway bookinfo-gateway networking.istio.io/service-type=ClusterIP --namespace=default

To check the status of the gateway, run:

  1. $ kubectl get gateway
  2. NAME CLASS ADDRESS PROGRAMMED AGE
  3. bookinfo-gateway istio bookinfo-gateway-istio.default.svc.cluster.local True 42s

Access the application

You will connect to the Bookinfo productpage service through the gateway you just provisioned. To access the gateway, you need to use the kubectl port-forward command:

  1. $ kubectl port-forward svc/bookinfo-gateway-istio 8080:80

Open your browser and navigate to http://localhost:8080/productpage to view the Bookinfo application.

Bookinfo Application
Bookinfo Application

If you refresh the page, you should see the book reviews and ratings changing as the requests are distributed across the different versions of the reviews service.

Next steps

Continue to the next section to add the application to the mesh, and learn how to secure and visualize the communication between the applications.