> For the complete documentation index, see [llms.txt](https://drnugent.gitbook.io/openshift-microservices/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://drnugent.gitbook.io/openshift-microservices/step-4-deploy-to-openshift.md).

# Step 4: Deploy to Red Hat OpenShift

## Architecture

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0QygY_gkfYr6X98W1p%2Fimage.png?alt=media\&token=886b6fe3-d20c-4569-96ec-c646cb0c4b97)

This is a quick lab that demonstrates how to deploy a public image from Docker Hub on OpenShift. As example image the 'authors' microservice from this workshop is used.

{% hint style="info" %}
**Note:** Not all images from Docker Hub can be installed. For example **OpenShift doesn't allow to deploy images which run under 'root'.** See the OpenShift [documentation](https://docs.openshift.com/container-platform/3.3/creating_images/guidelines.html) for details.
{% endhint %}

## Step 4.1: Launch Red Hat OpenShift Console <a href="#step-1" id="step-1"></a>

Open the **Red Hat OpenShift Console** from the IBM Cloud OpenShift dashboard:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0R8qLkAqaxzcpCujfG%2FScreen%20Shot%202020-02-19%20at%2012.32.21%20AM.png?alt=media\&token=a16908e9-ba0a-43b1-988a-b785de360029)

Your OpenShift Container Platform Dashboard will open in a new window.

{% hint style="info" %}
You may get a browser security exception when opening your Red Hat OpenShift Container Platform for the first time.&#x20;
{% endhint %}

## Step 4.2: Create a Project

Once you've launched your dashboard, on the left hand side, under **Home**, select **Projects**:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RAjwHOmraeyP-8C_7%2FScreen%20Shot%202020-02-19%20at%201.41.46%20AM.png?alt=media\&token=6d5c4e6d-9d7f-4c30-8c56-232316e35e5b)

Next, click **Create Project**:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RAvjBnPdzBLox4U60%2FScreen%20Shot%202020-02-19%20at%201.42.49%20AM.png?alt=media\&token=c4bf4c28-28e2-4cb2-8ed2-f2c2edc502bf)

We'll call our project **workshop** because we are very imaginative, but you can choose any name you wish. Click **Create**:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RB3G51qUjAaYxzNym%2FScreen%20Shot%202020-02-19%20at%201.43.29%20AM.png?alt=media\&token=3c588d02-fe3c-4271-9f94-f4523e8c1cbf)

Now, we see our empty **Project Details** page:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RBODow7rzU5ELJL_4%2FScreen%20Shot%202020-02-19%20at%201.44.53%20AM.png?alt=media\&token=3c598d1a-80a9-4183-a870-03e428d6e7be)

Now that our project is created, let's upload an image.

## Step 4.3: Deploy an Image

First, let's change to the *Developer Perspective*. On the left hand side, pull down the **Administrator** dropdown menu and select **Developer**:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RA1UCzYxEaUyBLKt2%2FScreen%20Shot%202020-02-19%20at%201.38.56%20AM.png?alt=media\&token=71a85172-b088-4034-9e44-130bc9837102)

You'll notice from the **Project:** dropdown menu at the top of the screen that we are in the **workshop** project that we just created in the Administrator Perspective. Click on **Container Image**:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RCS-o49c6i6nrR_l-%2FScreen%20Shot%202020-02-19%20at%201.47.06%20AM.png?alt=media\&token=0f5befdd-2c11-4b16-8d48-05962db5163b)

Although many times you would deploy from a private registry, we will just take a container image that we've found on Docker Hub called [**hello-openshift**](https://hub.docker.com/r/openshift/hello-openshift):

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RD08WnggNwLXVi70y%2FScreen%20Shot%202020-02-19%20at%201.51.21%20AM.png?alt=media\&token=74be7007-7a27-41bd-815a-60b7c3fca4bf)

Click the **blue magnifying glass** to the right of the image name and Red Hat OpenShift will give you more information about the image you're about to deploy:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RDLT6PNutVh7cpD7K%2FScreen%20Shot%202020-02-19%20at%201.53.02%20AM.png?alt=media\&token=2ad9e1e8-788c-45d5-873f-81370dcfc6d1)

Finally, scroll to the bottom and click **Create**.

After a few seconds, you'll see a new icon populating in your dashboard:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RDgurSCdsubeZeEAe%2FScreen%20Shot%202020-02-19%20at%201.54.53%20AM.png?alt=media\&token=d030e460-d779-43f9-a60d-6901d9c0f86c)

Click the Open URL icon in order to hit your deployed image's endpoint:

![](https://2911655690-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0Lc1S4MpE_49PkiglC%2F-M0Qu31dVb1TSMxR0H6S%2F-M0RDutQBsw_VLZuaFE8%2FScreen%20Shot%202020-02-19%20at%201.55.53%20AM.png?alt=media\&token=91b91765-6391-43f3-af32-164ff8554265)

A new browser window should pop up displaying the message:&#x20;

```
Hello OpenShift!
```

If you can see this, **congratulations**! You've successfully deployed an image from Docker Hub and executed it from an endpoint on your own private Red Hat OpenShift cluster.&#x20;

You may want to repeat these steps with another image from Docker Hub, or an image of your own creation!
