Deploying the Bookinfo sample

This page explains how to deploy a sample application to demonstrateCloud Service Mesh. If you haven't onboarded to Cloud Service Mesh, see theOnboarding guide.

Several sample applications come with the Cloud Service Mesh installation. Thisguide walks you through deploying theBookInfo sample. This is a simple mock bookstore application made up of four servicesthat provide a web product page, book details, reviews (with several versions ofthe review service), and ratings—all managed using Cloud Service Mesh. You canfind the source code and all the other files used in this example in yourCloud Service Mesh installation's directory insamples/bookinfo.

Enabling sidecar auto-injection

  1. Enable the namespace for injection. The steps depend on yourcontrol plane implementation.

    Managed (TD)

    1. Apply the default injection label to the namespace:
    kubectllabelnamespacedefault\istio.io/rev-istio-injection=enabled--overwrite

    Managed (Istiod)

    Recommended: Run the following command to apply the default injection label to the namespace:

    kubectllabelnamespacedefault\istio.io/rev-istio-injection=enabled--overwrite

    If you are an existing user with the Managed Istiod control plane:We recommend that you use default injection, but revision-based injection issupported. Use the following instructions:

    1. Run the following command to locate the available release channels:

      kubectl-nistio-systemgetcontrolplanerevision

      The output is similar to the following:

      NAME                AGEasm-managed-rapid   6d7h

      NOTE: If two control plane revisions appear in the list above, remove one. Having multiple control plane channels in the cluster is not supported.

      In the output, the value under theNAME column is the revision label that corresponds to the availablerelease channel for the Cloud Service Mesh version.

    2. Apply the revision label to the namespace:

      kubectllabelnamespacedefault\istio-injection-istio.io/rev=REVISION_LABEL--overwrite

    In-cluster

    Recommended: Run the following command to apply the default injection label to the namespace:

    kubectllabelnamespacedefault\istio.io/rev-istio-injection=enabled--overwrite

    We recommend that you use default injection, but revision-based injection is supported:Use the following instructions:

    1. Use the following command to locate the revision label onistiod:

      kubectlgetdeploy-nistio-system-lapp=istiod-o\jsonpath={.items[*].metadata.labels.'istio\.io\/rev'}'{"\n"}'
    2. Apply the revision label to the namespace. In the following command,REVISION_LABEL is the value of theistiod revisionlabel that you noted in the previous step.

      kubectllabelnamespacedefault\istio-injection-istio.io/rev=REVISION_LABEL--overwrite

Deploying the application

Now that auto-injection is enabled on thedefault namespace, when you deploythe BookInfo application's services, sidecar proxies are injected alongside eachservice.

  1. On the command line on the computer where you installed Cloud Service Mesh, go tothe root of the Cloud Service Mesh installation directory. If you need to,download the In-cluster installation file,which includes the bookinfo sample application, and extract it.

  2. Deploy your application to the default namespace usingkubectl:

    kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
  3. Confirm that the application has been deployed correctly by running thefollowing commands:

    kubectl get services

    Output:

    NAME                       CLUSTER-IP   EXTERNAL-IP   PORT(S)              AGEdetails                    10.0.0.31    <none>        9080/TCP             6mkubernetes                 10.0.0.1     <none>        443/TCP              7dproductpage                10.0.0.120   <none>        9080/TCP             6mratings                    10.0.0.15    <none>        9080/TCP             6mreviews                    10.0.0.170   <none>        9080/TCP             6m

    and

    kubectl get pod

    Output:

    NAME                                        READY     STATUS    RESTARTS   AGEdetails-v1-1520924117-48z17                 2/2       Running   0          6mproductpage-v1-560495357-jk1lz              2/2       Running   0          6mratings-v1-734492171-rnr5l                  2/2       Running   0          6mreviews-v1-874083890-f0qf0                  2/2       Running   0          6mreviews-v2-1343845940-b34q5                 2/2       Running   0          6mreviews-v3-1813607990-8ch52                 2/2       Running   0          6m
  4. Finally, define the ingress gateway routing for the application:

    kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml

    Output:

    gateway.networking.istio.io/bookinfo-gateway createdvirtualservice.networking.istio.io/bookinfo created

Validating the application deployment

To see if the BookInfo application is working, you need to send traffic tothe ingress gateway.

  • If you installed Cloud Service Mesh on Google Distributed Cloud (software only) for VMware, get the externalIP address for the ingress gateway that youconfiguredafter installing Cloud Service Mesh

  • If you installed Cloud Service Mesh on GKE, get the external IPaddress of the ingress gateway as follows:

    kubectl get service istio-ingressgateway -n istio-system

    Output:

    NAME                   TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                      AGEistio-ingressgateway   LoadBalancer   10.19.247.233   35.239.7.64   80:31380/TCP,443:31390/TCP,31400:31400/TCP   27m

    In this example, the IP address of the ingress service is35.239.7.64.

Trying the application

  1. Check that the BookInfo app is running withcurl:

    curl -I http://EXTERNAL_IP/productpage

    If the response shows200, it means the application is working properlywith Cloud Service Mesh.

  2. To view the BookInfo web page, enter the following address in your browser:

    http://EXTERNAL_IP/productpage

    If you refresh the page several times, you should see different versions ofreviews shown in the product page, presented in a round robin style(red stars, black stars, no stars).

Now that you have an application that is generating traffic, you canexplore the Cloud Service Mesh pagesin the Google Cloud console to see metrics and the other observabilityfeatures.

Cleaning up

When you are finished experimenting with the Bookinfo sample, remove it fromyour cluster.

  1. Uninstall Bookinfo using the following script:

    samples/bookinfo/platform/kube/cleanup.sh
  2. Confirm shutdown:

    kubectl get virtualservices   #-- there should be no virtual serviceskubectl get destinationrules  #-- there should be no destination ruleskubectl get gateway           #-- there should be no gatewaykubectl get pods              #-- the Bookinfo pods should be deleted

What's next

Learn more about the Bookinfo sample.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.