Set up the classroom and developer environment for the hands-on labs in the course.
Outcomes
Familiarize with the GitLab classroom instance.
Familiarize with the classroom image registry.
Access the classroom cluster by using the oc CLI and the Red Hat OpenShift web console.
Verify the odo CLI setup by building and deploying a sample application.
Verify the setup of the OpenShift Toolkit extension for VSCode.
As the student user on the workstation machine, use the lab start command to prepare your system for this exercise.
This command copies the exercise files to the course directory and creates a architecture-setup project in the cluster as the developer user.
[student@workstation ~]$ lab start architecture-setup
Instructions
Log in to the classroom GitLab instance.
Navigate to https://git.ocp4.example.com.
Log in to GitLab by using the developer user with the developer password.
![]() |
Explore the repositories available to the developer user.
![]() |
Verify that the classroom image registry is accessible and log in by using Podman.
Navigate to the https://registry.ocp4.example.com:8443 URL.
Log in to the registry by using the developer user with the developer password.
Then, click to log in.
Navigate to → and click .
Enter the developer password and click to validate the form.
To log in to the image registry, click , and copy the podman login command with the ENCRYPTED_PASSWORD.
![]() |
Paste the command to the terminal to log in.
[student@workstation ~]$ podman login -u="developer" -p="ENCRYPTED_PASSWORD" \
registry.ocp4.example.com:8443
Login Succeeded!Log in to the classroom cluster by using the oc CLI and the Red Hat OpenShift web console.
Run the oc login command with the developer user with the developer password.
[student@workstation ~]$ oc login -u developer -p developer \
https://api.ocp4.example.com:6443
Login successful.
...output omitted...To get the web console URL, run the oc whoami command with the --show-console option.
[student@workstation ~]$ oc whoami --show-console
https://console-openshift-console.apps.ocp4.example.comTo log in to the web console, navigate to the https://console-openshift-console.apps.ocp4.example.com URL, click , and use the developer user with the developer password.
![]() |
Validate that the odo CLI is properly configured by deploying the hello-flask sample application.
Change to the ~/DO288/labs/architecture-setup/hello-flask directory.
[student@workstation ~]$ cd ~/DO288/labs/architecture-setup/hello-flaskRun odo deploy to build the hello-flask container image and deploy it to the cluster.
Note that this command requires you to be logged in to the image registry and the cluster.
[student@workstation hello-flask]$ odo deploy
__
/ \__ Running the application in Deploy mode using hello-flask Devfile
\__/ \ Namespace: architecture-setup
/ \__/ odo version: v3.10.0
\__/
↪ Building & Pushing Image: registry.ocp4.example.com:8443/developer/hello-flask
• Building image locally ...
...output omitted...
✓ Building image locally [2s]
• Pushing image to container registry ...
...output omitted...
Writing manifest to image destination
Storing signatures
✓ Pushing image to container registry [1s]
↪ Deploying Kubernetes Component: hello-flask
✓ Creating resource Route/hello-flask
↪ Deploying Kubernetes Component: hello-flask
✓ Creating resource Service/hello-flask
↪ Deploying Kubernetes Component: hello-flask
✓ Creating resource Deployment/hello-flask
Your Devfile has been successfully deployedVerify that odo deploys the application by running the curl command to query the http://hello-flask-architecture-setup.apps.ocp4.example.com URL.
[student@workstation hello-flask]$ curl \
http://hello-flask-architecture-setup.apps.ocp4.example.com; echo
Hello World!Open the hello-flask application in VSCodium to verify that the Red Hat OpenShift Toolkit VSCode extension recognizes that the hello-flask application is running in the cluster.
Open VSCodium by running the codium command with the . path from the hello-flask directory.
[student@workstation hello-flask]$ codium .Click to close the modal window that shows the first time you open the project.
Click the icon to open the OpenShift Toolkit side panel.
The → → item shows the hello-flask application running in the cluster.
Also, the section shows that the OpenShift Toolkit recognizes the hello-flask source code in the current directory.
