mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
151 lines
4.8 KiB
Plaintext
151 lines
4.8 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
|
|
////
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="ossm-tutorial-bookinfo-install_{context}"]
|
|
= Installing the Bookinfo application
|
|
|
|
This tutorial walks you through how to create a sample application by creating a project, deploying the Bookinfo application to that project, and viewing the running application in {SMProductShortName}.
|
|
|
|
.Prerequisites
|
|
|
|
* {product-title} 4.1 or higher installed.
|
|
* {SMProductName} {SMProductVersion} installed.
|
|
* Access to the OpenShift CLI (`oc`).
|
|
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
* You are logged in to {product-title} as`cluster-admin`.
|
|
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
ifdef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
* You are logged in to {product-title} as a user with the `dedicated-admin` role.
|
|
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]
|
|
|
|
ifndef::openshift-rosa,openshift-rosa-hcp[]
|
|
[NOTE]
|
|
====
|
|
The Bookinfo sample application cannot be installed on {ibm-z-name} and {ibm-power-name}.
|
|
====
|
|
|
|
endif::openshift-rosa,openshift-rosa-hcp[]
|
|
[NOTE]
|
|
====
|
|
The commands in this section assume the {SMProductShortName} control plane project is `istio-system`. If you installed the control plane in another namespace, edit each command before you run it.
|
|
====
|
|
|
|
.Procedure
|
|
|
|
. Click *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 {SMProductShortName} control plane namespace. In this example, use `istio-system`.
|
|
|
|
. Click the *{SMProductName}* Operator.
|
|
|
|
. Click the *Istio Service Mesh Member Roll* tab.
|
|
|
|
.. 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 `ServiceMeshMemberRoll`, click *Create ServiceMeshMemberRoll*.
|
|
+
|
|
. Click *Members*, then enter the name of your project in the *Value* field.
|
|
+
|
|
. Click *Create* to save the updated Service Mesh Member Roll.
|
|
+
|
|
.. Or, save the following example to a YAML file.
|
|
+
|
|
.Bookinfo ServiceMeshMemberRoll example servicemeshmemberroll-default.yaml
|
|
[source,yaml]
|
|
----
|
|
apiVersion: maistra.io/v1
|
|
kind: ServiceMeshMemberRoll
|
|
metadata:
|
|
name: default
|
|
spec:
|
|
members:
|
|
- bookinfo
|
|
----
|
|
+
|
|
.. Run the following command to upload that file and create the `ServiceMeshMemberRoll` resource in the `istio-system` namespace. In this example, `istio-system` is the name of the {SMProductShortName} control plane project.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create -n istio-system -f servicemeshmemberroll-default.yaml
|
|
----
|
|
+
|
|
. Run the following command to verify the `ServiceMeshMemberRoll` was created successfully.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get smmr -n istio-system -o wide
|
|
----
|
|
+
|
|
The installation has finished successfully when the `STATUS` column is `Configured`.
|
|
+
|
|
[source,terminal]
|
|
----
|
|
NAME READY STATUS AGE MEMBERS
|
|
default 1/1 Configured 70s ["bookinfo"]
|
|
----
|
|
. 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
|
|
----
|
|
+
|
|
You should see output similar to the following:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
service/details created
|
|
serviceaccount/bookinfo-details created
|
|
deployment.apps/details-v1 created
|
|
service/ratings created
|
|
serviceaccount/bookinfo-ratings created
|
|
deployment.apps/ratings-v1 created
|
|
service/reviews created
|
|
serviceaccount/bookinfo-reviews created
|
|
deployment.apps/reviews-v1 created
|
|
deployment.apps/reviews-v2 created
|
|
deployment.apps/reviews-v3 created
|
|
service/productpage created
|
|
serviceaccount/bookinfo-productpage created
|
|
deployment.apps/productpage-v1 created
|
|
----
|
|
+
|
|
. 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
|
|
----
|
|
+
|
|
You should see output similar to the following:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
gateway.networking.istio.io/bookinfo-gateway created
|
|
virtualservice.networking.istio.io/bookinfo created
|
|
----
|
|
+
|
|
. Set the value for the `GATEWAY_URL` parameter:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ export GATEWAY_URL=$(oc -n istio-system get route istio-ingressgateway -o jsonpath='{.spec.host}')
|
|
----
|