# Exercise 1 - Setup via Script

In this short exercise you'll deploy Kafka, PostgreSQL, and the Microservices of the reactive example via a script and test the example application.

## Step 1: Deploy the example application

Invoke the following command:

```
bash ~/cloud-native-starter/reactive/os4-scripts/deploy-example.sh
```

> The deployment takes approximately `10 minutes`.

The script console output shows links to the Microservices and the Web-App at the end of the execution.

The following `35 sec` YouTube video shows a example execution of the script and the test of the application.

[![](https://img.youtube.com/vi/RYGCrsR37Go/0.jpg)](https://www.youtube.com/watch?v=RYGCrsR37Go)

## Step 2: Launch the web application

To launch the web application get the URL from the last output and open the application in a browser.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F463796fbe3f3ec52df6dffae66b9d1cd7f5b922f.png?generation=1598944909720044\&alt=media)

## Step 3: Copy the curl command

Copy the curl command to create a new article and insert it into your current terminal session.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2Fecc426bbae337e9dce7e354a79476baf35819090.png?generation=1598944909729919\&alt=media)

## Step 4: Test the example application

Open the web application in a browser. Then invoke the curl post command. The web application should show the new entry.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F536175c07f8913d3e24b7174cd62ab10c9a4ba29.png?generation=1591086454426076\&alt=media)

## Step 5 (optional): Verify the deployed PostgreSQL

You can check the status via the OpenShift web console. On the 'Pods' page select the 'postgres' project.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F64c6fe5d932c211ff51f0f6dd527773960a1e412.png?generation=1598944909071178\&alt=media)

## Step 6 (optional): Verify the deployed Kafka

You can check the status via the OpenShift web console. On the 'Pods' page select the 'kafka' project.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F8f490e5ddd2c4a901837c9c64ad95c907e7d1fdb.png?generation=1591086436508425\&alt=media)

## Step 7 (optional): Verify the deployed Services and Web Application

Make sure all four pods in the 'cloud-native-starter' project are running.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F16f6915bdc3e96bc05a87c9b213e703f698b0081.png?generation=1591086429659164\&alt=media)

The previous steps have create build configs, builds and image streams.

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2Fa45ed0441ab60d492d3113cd924eb4ff0a32db4c.png?generation=1591086447537412\&alt=media)

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F1121a5697f969abc708fbec3212276d9de59f299.png?generation=1591086448539128\&alt=media)

![](https://2094539152-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M8o7TovHRYmD6AT4Wrf%2Fsync%2F2dce7bf3f0109f1291b5acd8c1511b14dfe88a95.png?generation=1591086449509749\&alt=media)
