$ oc adm policy add-scc-to-user anyuid -z default -n myproject
$ oc adm policy add-scc-to-user privileged -z default -n myproject
The following steps describe the deployment of Bookinfo application on Maistra running on Openshift.
Install Maistra by following the instructions here.
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
Download bookinfo.yaml
into your local directory:
$ curl -o bookinfo.yaml https://raw.githubusercontent.com/Maistra/bookinfo/master/bookinfo.yaml
Deploy the Bookinfo application in the "myproject" namespace:
$ oc apply -n myproject -f bookinfo.yaml
Download bookinfo-gateway.yaml
into your local directory:
$ curl -o bookinfo-gateway.yaml https://raw.githubusercontent.com/Maistra/bookinfo/master/bookinfo-gateway.yaml
Create the ingress gateway for Bookinfo:
$ oc apply -f bookinfo-gateway.yaml
Set GATEWAY_URL
:
$ export GATEWAY_URL=$(oc get route -n istio-system istio-ingressgateway -o jsonpath='{.spec.host}')
To confirm that Bookinfo 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.
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
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
Download cleanup script:
$ curl -o cleanup.sh https://raw.githubusercontent.com/Maistra/bookinfo/master/cleanup.sh && chmod +x ./cleanup.sh
Delete the bookinfo virtualservice, gateway, and terminate the pods:
$ ./cleanup.sh
namespace ? [default] myproject
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.