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
Enable the namespace for injection. The steps depend on yourcontrol plane implementation.
Managed (TD)
- Apply the default injection label to the namespace:
kubectllabelnamespacedefault\istio.io/rev-istio-injection=enabled--overwriteManaged (Istiod)
Recommended: Run the following command to apply the default injection label to the namespace:
kubectllabelnamespacedefault\istio.io/rev-istio-injection=enabled--overwriteIf 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:
Run the following command to locate the available release channels:
kubectl-nistio-systemgetcontrolplanerevisionThe output is similar to the following:
NAME AGEasm-managed-rapid 6d7hNOTE: 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 the
NAMEcolumn is the revision label that corresponds to the availablerelease channel for the Cloud Service Mesh version.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--overwriteWe recommend that you use default injection, but revision-based injection is supported:Use the following instructions:
Use the following command to locate the revision label on
istiod:kubectlgetdeploy-nistio-system-lapp=istiod-o\jsonpath={.items[*].metadata.labels.'istio\.io\/rev'}'{"\n"}'Apply the revision label to the namespace. In the following command,
REVISION_LABELis the value of theistiodrevisionlabel 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.
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.
Deploy your application to the default namespace using
kubectl:kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yamlConfirm that the application has been deployed correctly by running thefollowing commands:
kubectl get servicesOutput:
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 podOutput:
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
Finally, define the ingress gateway routing for the application:
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yamlOutput:
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-systemOutput:
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 is
35.239.7.64.
Trying the application
Check that the BookInfo app is running with
curl:curl -I http://EXTERNAL_IP/productpageIf the response shows
200, it means the application is working properlywith Cloud Service Mesh.To view the BookInfo web page, enter the following address in your browser:
http://EXTERNAL_IP/productpageIf 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.
Uninstall Bookinfo using the following script:
samples/bookinfo/platform/kube/cleanup.shConfirm 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.