# Step 4: Deploy to Red Hat OpenShift

## Architecture

![](/files/-M0QygY_gkfYr6X98W1p)

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:

![](/files/-M0R8qLkAqaxzcpCujfG)

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**:

![](/files/-M0RAjwHOmraeyP-8C_7)

Next, click **Create Project**:

![](/files/-M0RAvjBnPdzBLox4U60)

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

![](/files/-M0RB3G51qUjAaYxzNym)

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

![](/files/-M0RBODow7rzU5ELJL_4)

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**:

![](/files/-M0RA1UCzYxEaUyBLKt2)

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**:

![](/files/-M0RCS-o49c6i6nrR_l-)

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):

![](/files/-M0RD08WnggNwLXVi70y)

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:

![](/files/-M0RDLT6PNutVh7cpD7K)

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

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

![](/files/-M0RDgurSCdsubeZeEAe)

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

![](/files/-M0RDutQBsw_VLZuaFE8)

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!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://drnugent.gitbook.io/openshift-microservices/step-4-deploy-to-openshift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
