Bookinfo

Bookinfo Application

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

Before you Begin

Install Maistra by following the instructions here.

Create Bookinfo project

  $ oc new-project bookinfo

Update Security Context Constraints

To add the service account used by Bookinfo application to anyuid and privileged SCCs in "bookinfo" project:

  $ oc adm policy add-scc-to-user anyuid -z default -n bookinfo
  $ oc adm policy add-scc-to-user privileged -z default -n bookinfo

Deploy Bookinfo Application

  1. Deploy the Bookinfo application in the bookinfo project:

      $ oc -n bookinfo apply -f https://raw.githubusercontent.com/Maistra/bookinfo/maistra-0.12/bookinfo.yaml
  2. Create the ingress gateway for Bookinfo:

      $ oc -n bookinfo apply -f https://raw.githubusercontent.com/Maistra/bookinfo/maistra-0.12/bookinfo-gateway.yaml
  3. Set GATEWAY_URL:

      $ export GATEWAY_URL=$(oc -n istio-system get route istio-ingressgateway -o jsonpath='{.spec.host}')

Confirm Bookinfo is running

To confirm that Bookinfo has been successfully deployed:

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

You should get 200 as a response. 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 apply -f https://raw.githubusercontent.com/istio/istio/release-1.1/samples/bookinfo/networking/destination-rule-all.yaml
  2. If you did enable mutual TLS:

      $ oc -n bookinfo apply -f https://raw.githubusercontent.com/istio/istio/release-1.1/samples/bookinfo/networking/destination-rule-all-mtls.yaml
  3. To list all available destination rules:

      $ oc -n bookinfo get destinationrules -o yaml

Cleanup

Delete the bookinfo project - this will wipe everything we created above:

  $ oc delete project bookinfo