What Lab 4 teaches
Lab 4 teaches how to use the oc CLI tool from a local machine to deploy an application on a remote OpenShift cluster from a Linux container image stored in a container image repository.
The sample image used is:
quay.io/rhdevelopers/greeter
The main deployment command in the PDF is:
oc new-app quay.io/rhdevelopers/greeter
Code language: JavaScript (javascript)
The expected output shows OpenShift creating:
imagestream.image.openshift.io "greeter" created
deployment.apps "greeter" created
service "greeter" created
Code language: CSS (css)
Then OpenShift says the application is not exposed and suggests:
oc expose service/greeter
Main lab flow
| Step | What the learner does | Command / Action |
|---|---|---|
| 1 | Open Developer Sandbox web console | Browser action |
| 2 | Open command-line login page | Question mark → Command Line tools |
| 3 | Display token | Click Display Token |
| 4 | Copy login command | Copy Log in with this token |
| 5 | Log in from local terminal | Paste the copied oc login --token=... --server=... command |
| 6 | Deploy app from image | oc new-app quay.io/rhdevelopers/greeter |
| 7 | Expose app externally | oc expose service/greeter |
| 8 | Open app from Topology | Click external URL icon |
| 9 | Check labels | oc get deployment --show-labels |
| 10 | Delete app resources | oc delete all -l app=greeter |
Clean CLI version of Lab 4
# Log in using the token command copied from OpenShift web console
oc login --token=<your-token> --server=<your-api-server>
# Confirm login
oc whoami
# Check current project
oc project
# Deploy the app from a container image
oc new-app quay.io/rhdevelopers/greeter
# Check created resources
oc get all
# Expose the service as a route
oc expose service/greeter
# Get the route
oc get route greeter
# Open/test the app
curl -I http://$(oc get route greeter -o jsonpath='{.spec.host}')
# View deployment labels
oc get deployment --show-labels
# Delete all app resources by label
oc delete all -l app=greeter
Code language: PHP (php)
So yes, this lab is basically the CLI version of Lab 3, but it uses a different sample image: quay.io/rhdevelopers/greeter instead of the Lab 3 ParksMap image.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow , and SEO strategies at Wizbrand.
Do you want to learn Quantum Computing?
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at WIZBRAND
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals
The guide covers the basics of deploying container images with the
ocCLI well, but it would be worthwhile to address some day-to-day operational considerations. In production environments, teams typically rely on image signing, vulnerability scanning, and controlled promotion pipelines to strengthen security and traceability. It may also be helpful to discuss the benefits of immutable image references and deployment rollback procedures to ensure more predictable and resilient application updates.