Digital Developer Conference: Hybrid Cloud
  • Introduction
  • Getting Started
    • Pre-work
  • Threat Modeling & Identity Management
    • Lecture
      • Threat Modeling
      • Identity Management
      • Prerequisites
    • Lab 1
      • Clone the repo
      • Creating App ID in IBM Cloud
      • Building the front end service
      • Deploying to OpenShift
      • Test the Simulator
  • Operator Workshop
    • Lecture
      • Introduction
    • Lab 2
      • Install the PostgreSQL Operator
      • Create an instance of a database
      • Load the schema
      • Expose and verify
  • Microservice Workshop
    • Lecture
      • Introduction
      • Prerequisites
    • Lab 3
      • Part 1
      • Part 2
  • Microservice Workshop (OSS)
    • Lecture
      • Introduction
      • Prerequisites
    • Lab
      • Database setup
      • Part 1
      • Part 2
  • Serverless Workshop
    • Introduction
      • Example Bank App Architecture
      • Serverless
      • Prerequisites
      • Quick Install - Identity Management, Operator, Microservices Workshops
    • Lab 4
      • Installing OpenShift Serverless
      • Installing Knative Serving
      • Clone the repo
      • Create an admin scoped user
      • Building the example serverless application
      • Configure Deployment file
      • Deploying to OpenShift Serverless
      • Test the Serverless App
      • Modify Serverless App
      • Conclusion
  • Service Mesh Workshop
    • ServiceMesh Lab
  • Pipelines (Tekton) Workshop
    • Lecture
      • What is tekton?
      • CI/CD
      • Explain tasks and pipelines
    • Lab 6
      • Cluster Setup
      • Install Pipeline
  • Resources
    • IBM Developer
Powered by GitBook
On this page
  • OpenShift Service Mesh for Example Bank
  • Part 1: Deploy Example Bank
  • Part 2: Service Mesh Setup

Was this helpful?

  1. Service Mesh Workshop

ServiceMesh Lab

PreviousConclusionNextLecture

Last updated 4 years ago

Was this helpful?

OpenShift Service Mesh for Example Bank

Part 1: Deploy Example Bank

Login and checkout Example Bank github repo.

oc login
ibmcloud login -u <account name>
git clone https://github.com/IBM/example-bank.git
oc new-project example-bank
cd example-bank/scripts/
./createappid.sh
./createsecrets.sh <AppId Management Server URL> <API Key>
./deploy-db.sh
./installServerlessOperator.sh
  • Note: Verify the creditdb database pod is in Running state before running the SQL schema loader.

Deploy front end service and SQL data schema.

oc apply -f deployment.yaml
oc apply -f data_model/job.yaml

Verify schema loaded to ensure the database is ready to use.

oc logs cc-schema-load-<pod>

Deploy back-end services:

oc apply -f bank-app-backend/transaction-service/deployment.yaml -f bank-app-backend/user-service/deployment.yaml

Deploy the Serverless (knative) service.

cd bank-knative-service/
oc apply -f deployment.yaml

Verify it's running:

oc get kservice

At this point we can verify the app is running prior to setting up service mesh. We are using an OpenShift route.

oc get routes

Visit URL for the mobile simulator route.

Part 2: Service Mesh Setup

Open up the OpenShift console, navigate to the the OperatorHub, install operators in this order:

  1. Elastic Search (choose version 4.3)

  2. Jaeger Operator

  3. Kiali

  4. Service Mesh Operator

Create a new project called istio-system.

Go to installed operators, and wait until they become available in this namespace.

While waiting, check out the service-mesh branch:

git checkout service-mesh
`

Next steps:

  • Create Control Plane instance.

  • Create ServiceMeshMemberRolls

Verify install:

oc get smmr -o yaml --all-namespaces | egrep -A2 'ControlPlane|configuredMembers'

Open up a second terminal to watch pods: watch -n1 oc get pods

Deploy with sidecar enabled:

oc apply -f bank-app-backend/user-service/deployment.yaml -f bank-app-backend/transaction-service/deployment.yaml -f deployment.yaml

Patch database pod to inject the Istio sidecar.

kubectl patch deployments.apps creditdb -p '{"spec":{"template":{"metadata":{"annotations":{"sidecar.istio.io/inject":"true"}}}}}'

Delete route and replace with Istio ingress gateway:

oc delete routes --all
oc apply -f bank-istio-gw.yaml

Force mTLS between database and other services:

oc apply -f bank-istio-policy.yaml -f bank-istio-destination-mtls.yaml

Enable knative-serving with Istio.

./label-knative.sh

This sets the appropriate labels in the knative-serving namespace allowing the knative service to be triggered.

Redeploy the knative service with the Istio sidecar annotation.

oc apply -f bank-knative-service/network.yaml
oc apply -f bank-knative-service/deployment.yaml

We are updating the cleanup utility because we need to send a signal to the Envoy sidecar to exit after the job completes.

oc delete -f bank-user-cleanup-utility/job.yaml
oc apply -f bank-user-cleanup-utility/job.yaml

Expose access via OpenShift secured route. Go to istio-system namespace in Admin console.

Set port 80 -> 8080, Edge, Redirect. Default OpenShift certs can be used, or you can upload your own certificates.

Click on "Padlock" to examine certs.

Use bank simulator. Note that all relevant pods have extra container.

Open up Kiali from App square to view traffic flow.

Badge

Click on URL, e.g.

kiali

After completion of the workshop, you can collect your

https://example-bank-istio-system.first-test-cluster-f8c169e6934c89d328b2b987ec7f7018-0000.us-south.containers.appdomain.cloud/
badge
Example Bank diagram