Monitoring & Tracing

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.

Update Security Context Constraints

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

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

Deploying Bookinfo Application

  1. Download bookinfo.yaml into your local directory:

      $ curl -o bookinfo.yaml https://raw.githubusercontent.com/Maistra/bookinfo/master/bookinfo.yaml
  2. Deploy Bookinfo application in "myproject" namespace:

      $ oc apply -n myproject -f bookinfo.yaml
  3. Download bookinfo-gateway.yaml into your local directory:

      $ curl -o bookinfo-gateway.yaml https://raw.githubusercontent.com/Maistra/bookinfo/master/bookinfo-gateway.yaml
  4. Create the ingress gateway for Bookinfo:

      $ oc apply -f bookinfo-gateway.yaml
  5. Set GATEWAY_URL:

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

Confirm Bookinfo is running

To confirm that the application has been successfully deployed:

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

Alternatively, you can open http://$GATEWAY_URL/productpage in your browser.

Add default destination rules

  1. If you did not enable mutual TLS:

      $ curl -o destination-rule-all.yaml https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all.yaml
      $ oc apply -f destination-rule-all.yaml
  2. If you enabled mutual TLS:

      $ curl -o destination-rule-all-mtls.yaml https://raw.githubusercontent.com/istio/istio/release-1.0/samples/bookinfo/networking/destination-rule-all-mtls.yaml
      $ oc apply -f destination-rule-all-mtls.yaml
    To list all available destination rules:
  $oc get destinationrules -o yaml
[[cleanup]]

Cleanup

  1. Download cleanup script:

      $ curl -o cleanup.sh https://raw.githubusercontent.com/Maistra/bookinfo/master/cleanup.sh && chmod +x ./cleanup.sh
  2. Delete bookinfo virtualservice, gateway, and terminate the pods:

      $ ./cleanup.sh
      namespace ? [default] myproject
  3. Confirm shutdown:

      $ oc get virtualservices -n myproject
      No resources found.
      $ oc get gateway -n myproject
      No resources found.
      $ oc get pods -n myproject
      No resources found.