Deploy simple applications by using the various methods that the Red Hat OpenShift web console provides.
Outcomes
Deploy an application by using a Git repository.
Deploy an application by using an image from a container registry.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start deploy-console
This command creates the deploy-console project in the Red Hat OpenShift Container Platform (RHOCP) cluster.
Instructions
Deploy the following two applications in the deploy-console project.
| Name | Runtime | Strategy |
|---|---|---|
hello-world
| PHP | Import from the apps/deploy-console/php-helloworld directory of the https://git.ocp4.example.com/developer/DO288-apps.git repository |
todo-list
| Node.js | From the registry.ocp4.example.com:8443/redhattraining/openshift-dev-deploy-console-todo-list container image |
Log in to RHOCP and select the developer perspective.
Open a web browser and navigate to https://console-openshift-console.apps.ocp4.example.com.
Click and log in as the developer user with the developer password.
From the side menu, click to ensure that you use the developer perspective.
![]() |
Ensure that the selected project is deploy-console.
![]() |
Deploy the PHP application from the Git repository.
Click to open the Add page.
![]() |
In the card, click .

Enter https://git.ocp4.example.com/developer/DO288-apps.git in the field.
You might see a warning indicating that the repository is not reachable.
In the field, select GitLab.
The web console validates the repository.

Click , then enter apps/deploy-console/php-helloworld in the field.
The form detects that the directory contains a PHP application and changes the import strategy to the PHP 8.0 (UBI) builder image.
![]() |
Under the section, enter hello-world in the and fields.

Under the section, ensure that the target port is 8080 and the option is selected.

Click . The web console redirects you to the topology view.
Verify that the hello-world PHP application has been deployed successfully.
In the topology view, verify that the hello-world application is running.
After a few seconds, the circular border of the hello-world deployment must transition from light blue to dark blue, which indicates that the application pod is running.

Click the icon.
On the hello-world tab that opens, verify that the application response is similar to the following message:
Hello, World! php version is ...
Deploy the Node.js application.
Click to open the Add page.
Click .
![]() |
Enter registry.ocp4.example.com:8443/redhattraining/openshift-dev-deploy-console-todo-list as the image name from the external registry.
From the list, select nodejs.
This change can help you identify the deployment as a Node.js application in the topology view.
Under the section, select in the field.
![]() |
Enter todo-list in the and fields.
![]() |
Under the section, ensure that the target port is 3000 and the option is selected.
![]() |
Click . The web console redirects you to the topology view.
Verify that the todo-list Node.js application has been deployed successfully.
The application exposes a /todos endpoint that accepts POST and GET actions.
Test that these actions create and retrieve items.
In the topology view, verify that the todo-list application is running.
The todo-list deployment icon must display a dark blue circle, a few seconds after you create the application.
![]() |
Click the Node.js application icon to open the deployment details.
In the side pane that opens, click .
Copy the URL under the section.
![]() |
Test that the application can create items.
Return to the terminal and use the copied URL to send a POST request to the /todos endpoint, by running the following command:
[student@workstation ~]$ curl -i -H "Content-Type: application/json" \
https://todo-list-deploy-console.apps.ocp4.example.com/todos \
--data '{ "task": "Say hello" }'
HTTP/1.1 201 Created
...output omitted...The application saves the item and returns a 201 Created HTTP response.
Retrieve the list of items by running the following command:
[student@workstation ~]$ curl -s \
https://todo-list-deploy-console.apps.ocp4.example.com/todos | jq
[
{
"task": "Say hello"
}
]