Bookinfo application

The following steps describe the deployment of the Bookinfo application on Maistra.

Before you begin

Install Maistra by following the installation instructions.

Create the Bookinfo project

Maistra takes a multi-tenant approach, meaning that you can have more than one control plane in your OpenShift cluster. Substitute <project> with the project of your control plane and <bookinfo> with the name of the project to use for the Bookinfo example.

$ export CONTROL_PLANE_NS=<project>
$ export BOOKINFO_NS=bookinfo
$ oc new-project ${BOOKINFO_NS}

In OpenShift 3, Security Context Constraints (SCC) must be configured for the Bookinfo application. Additional information can be found here.

Add Bookinfo project to the Service Mesh

To add the bookinfo project to the control plane SMMR:

$ oc -n ${CONTROL_PLANE_NS} patch --type='json' smmr default -p '[{"op": "add", "path": "/spec/members", "value":["'"${BOOKINFO_NS}"'"]}]' patched

The command above adds the Bookinfo project to the control plane’s ServiceMeshMemberRoll (SMMR) object as an one-line shell command. If you prefer, you can edit it interactively with the help of a text editor by running the command below and adding the Bookinfo project into the spec.members list:

$ oc -n ${CONTROL_PLANE_NS} edit smmr default edited

At this point Bookinfo project is part of the Service Mesh, meaning that when pods (with the proper annotation, which is the case of our Bookinfo deployment below) are deployed in Bookinfo project they will get the sidecar attached and thus will become part of the mesh.

Deploy Bookinfo Application

  1. Deploy the Bookinfo application in the bookinfo project:

    $ oc -n ${BOOKINFO_NS} apply -f
    service/details created
    deployment.extensions/details-v1 created
    service/ratings created
    deployment.extensions/ratings-v1 created
    service/reviews created
    deployment.extensions/reviews-v1 created
    deployment.extensions/reviews-v2 created
    deployment.extensions/reviews-v3 created
    service/productpage created
    deployment.extensions/productpage-v1 created
  2. Create the ingress gateway for Bookinfo:

    $ oc -n ${BOOKINFO_NS} apply -f
    /samples/bookinfo/networking/bookinfo-gateway.yaml created created

    $ export GATEWAY_URL=$(oc -n ${CONTROL_PLANE_NS} get route istio-ingressgateway -o jsonpath='{}')

Confirm Bookinfo is running

To confirm that Bookinfo has been successfully deployed, execute a curl request and confirm that you get a 200 OK in response.

$ curl -o /dev/null -s -w "%{http_code}\n" http://${GATEWAY_URL}/productpage

Alternatively, you can open it in your browser:

$ xdg-open http://${GATEWAY_URL}/productpage

Add default destination rules

  1. If you did not enable mutual TLS:

    $ oc -n ${BOOKINFO_NS} apply -f
    /samples/bookinfo/networking/destination-rule-all.yaml created created created created
  2. If you did enable mutual TLS:

    $ oc -n ${BOOKINFO_NS} apply -f
    /samples/bookinfo/networking/destination-rule-all-mtls.yaml configured configured configured configured


Delete the bookinfo project to remove the Bookinfo resources.

$ oc delete project ${BOOKINFO_NS} "bookinfo" deleted

Remove the bookinfo project from the control plane’s SMMR object. Run the following command and remove the bookinfo entry from the spec.members list.

$ oc -n ${CONTROL_PLANE_NS} edit smmr default edited