1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00
Files
openshift-docs/modules/ossm-tutorial-bookinfo-install.adoc
2020-10-07 13:27:48 -04:00

115 lines
3.6 KiB
Plaintext

////
This PROCEDURE module included in the following assemblies:
* service_mesh/v1x/prepare-to-deploy-applications-ossm.adoc
* service_mesh/v2x/prepare-to-deploy-applications-ossm.adoc
////
[id="ossm-tutorial-bookinfo-install_{context}"]
= Installing the Bookinfo application
This tutorial walks you through creating a Bookinfo project, deploying the Bookinfo application, and running Bookinfo on {product-title} with {ProductShortName} {ProductVersion}.
[WARNING]
====
The Bookinfo example application allows you to test your {ProductName} {ProductVersion} installation on {product-title}.
Red Hat does not provide support for the Bookinfo application.
====
.Prerequisites:
* {product-title} 4.1 or higher installed.
* {ProductName} {ProductVersion} installed.
* Access to the {product-title} Command-line Interface (CLI) also known as `oc`.
[NOTE]
====
{ProductName} implements auto-injection differently than the upstream Istio project, therefore this procedure uses a version of the `bookinfo.yaml` file annotated to enable automatic injection of the Istio sidecar for {ProductName}.
====
.Procedure
. Log in to the {product-title} web console as a user with cluster-admin rights.
. Click to *Home* -> *Projects*.
. Click *Create Project*.
. Enter `bookinfo` as the *Project Name*, enter a *Display Name*, and enter a *Description*, then click *Create*.
+
** Alternatively, you can run this command from the CLI to create the `bookinfo` project.
+
[source,terminal]
----
$ oc new-project bookinfo
----
+
. Click *Operators* -> *Installed Operators*.
. Click the *Project* menu and use the control plane namespace. In this example, use `istio-system`.
. Click the *{ProductName}* Operator.
. Click the *Istio Service Mesh Member Roll* link.
.. If you have already created a Istio Service Mesh Member Roll, click the name, then click the YAML tab to open the YAML editor.
.. If you have not created a Istio Service Mesh Member Roll, click *Create Service Mesh Member Roll*.
+
[NOTE]
====
You need cluster-admin rights to edit the Istio Service Mesh Member Roll.
====
+
. Edit the default Service Mesh Member Roll YAML and add `bookinfo` to the *members* list.
+
.Bookinfo ServiceMeshMemberRoll example
[source,yaml]
----
apiVersion: maistra.io/v1
kind: ServiceMeshMemberRoll
metadata:
name: default
spec:
members:
- bookinfo
----
+
** Alternatively, you can run this command from the CLI to add the `bookinfo` project to the `ServiceMeshMemberRoll`. Replace `<control_plane_project>` with the name of your control plane project.
+
[source,terminal]
----
$ oc -n <control_plane_project> patch --type='json' smmr default -p '[{"op": "add", "path": "/spec/members", "value":["'"bookinfo"'"]}]'
----
+
. Click *Create* to save the updated Service Mesh Member Roll.
. From the CLI, deploy the Bookinfo application in the _`bookinfo`_ project by applying the `bookinfo.yaml` file:
+
[source,bash,subs="attributes"]
----
$ oc apply -n bookinfo -f https://raw.githubusercontent.com/Maistra/istio/maistra-{MaistraVersion}/samples/bookinfo/platform/kube/bookinfo.yaml
----
+
. Create the ingress gateway by applying the `bookinfo-gateway.yaml` file:
+
[source,bash,subs="attributes"]
----
$ oc apply -n bookinfo -f https://raw.githubusercontent.com/Maistra/istio/maistra-{MaistraVersion}/samples/bookinfo/networking/bookinfo-gateway.yaml
----
+
. Set the value for the `GATEWAY_URL` parameter:
+
[NOTE]
====
Replace `<control_plane_project>` with the name of your control plane project. In this example, the control plane project is `istio-system`.
====
+
[source,terminal]
----
$ export GATEWAY_URL=$(oc -n <control_plane_project> get route istio-ingressgateway -o jsonpath='{.spec.host}')
----