Lab Objective
In this lab, you will build and deploy a web application from source code stored in a Git repository using the OpenShift web console.
You will use OpenShift Local, also known as CRC, as the local OpenShift environment.
This lab replaces the older Developer Sandbox-based lab and updates the steps for a local OpenShift learning environment.
By the end of this lab, you will understand how OpenShift takes application source code from Git, builds a container image using Source-to-Image, deploys the application, creates a Service, creates a Route, and makes the application accessible from a browser.
What You Will Learn
You will learn how to:
- Start OpenShift Local.
- Log in to the OpenShift web console.
- Create a new OpenShift project.
- Import application source code from a Git repository.
- Use OpenShift Source-to-Image, also called S2I.
- Build a container image from application source code.
- Deploy the built image as a Kubernetes Deployment.
- Expose the application internally using a Service.
- Expose the application externally using a Route.
- View the application in a browser.
- Inspect BuildConfig, Build, ImageStream, Deployment, Pod, Service, and Route resources.
- View build logs and pod logs.
- Trigger a rebuild manually.
- Troubleshoot common build and deployment issues.
- Clean up the lab environment.
Lab Architecture
The lab follows this flow:
Git Repository
|
v
OpenShift Import from Git
|
v
Source-to-Image Build
|
v
BuildConfig
|
v
Build Pod
|
v
ImageStream
|
v
Deployment
|
v
Pod
|
v
Service
|
v
Route
|
v
Browser
Code language: JavaScript (javascript)
OpenShift Resources Created in This Lab
When you import the application from Git, OpenShift creates several resources automatically.
| Resource | Purpose |
|---|---|
| Project | Isolates the lab resources |
| BuildConfig | Defines how the source code will be built |
| Build | Represents one build execution |
| ImageStream | Tracks the built application image inside OpenShift |
| Deployment | Runs the application as pods |
| ReplicaSet | Maintains the desired number of pods for the Deployment |
| Pod | Runs the application container |
| Service | Provides stable internal access to the pod |
| Route | Provides browser access to the application from outside the cluster |
Important Concept: What Is Source-to-Image?
Source-to-Image, usually called S2I, is an OpenShift build strategy.
With S2I, you provide source code from Git. OpenShift combines that source code with a builder image, such as a Node.js builder image, and creates a runnable container image.
In simple words:
Source Code + Builder Image = Runnable Application Image
For this lab:
Node.js source code + Node.js S2I builder image = Node.js application container image
Important Concept: Why Use Deployment Instead of DeploymentConfig?
Older OpenShift tutorials often used DeploymentConfig.
For current beginner labs, use Deployment.
A Deployment is the standard Kubernetes workload resource. It is easier for students to understand because it matches Kubernetes concepts directly.
In this lab, select:
Resource type: Deployment
Do not select:
DeploymentConfig
Lab Environment
This lab is written for:
OpenShift Local / CRC
OpenShift Container Platform 4.x
Developer user
OpenShift web console
oc CLI
Code language: JavaScript (javascript)
The exact OpenShift version may vary depending on the OpenShift Local version installed on your machine.
Part 1: Prerequisites
Required Software
You need:
- OpenShift Local installed.
- The
crccommand available. - The
occommand available. - A browser.
- Internet access from the OpenShift Local VM to GitHub and container registries.
Recommended Machine Resources
For a smooth student lab, use at least:
| Resource | Recommended |
|---|---|
| CPU | 4 cores or more |
| Memory | 12 GB or more |
| Disk | 35 GB or more |
If your laptop has limited resources, builds may take longer.
Part 2: Start OpenShift Local
Open a terminal.
Check the CRC version:
crc version
Set CRC to use the OpenShift preset:
crc config set preset openshift
Code language: JavaScript (javascript)
Run setup:
crc setup
Start OpenShift Local:
crc start
The startup can take several minutes.
When the cluster starts, CRC prints the web console URL and login credentials.
To view the credentials again, run:
crc console --credentials
Code language: JavaScript (javascript)
To open the web console, run:
crc console
Code language: JavaScript (javascript)
Part 3: Configure the oc CLI
Run:
crc oc-env
On Linux or macOS, apply the printed command:
eval $(crc oc-env)
Code language: JavaScript (javascript)
On Windows PowerShell, use the command printed by crc oc-env for PowerShell.
Now log in as the developer user.
Get the password:
crc console --credentials
Code language: JavaScript (javascript)
Login command:
oc login -u developer https://api.crc.testing:6443
Code language: JavaScript (javascript)
Enter the developer password when prompted.
Verify the login:
oc whoami
Expected output:
developer
Check the node:
oc get nodes
Code language: JavaScript (javascript)
Expected output will look similar to this:
NAME STATUS ROLES AGE VERSION
crc-xxxxx-master-0 Ready control-plane,master,worker ... v1.xx.x
Code language: CSS (css)
The exact node name and version will be different in your environment.
Part 4: Create a New Project
You can create the project from the web console or from the CLI.
Option A: Create Project from Web Console
- Open the OpenShift web console.
- Log in as:
Username: developer
Password: Use the password from crc console --credentials
Code language: JavaScript (javascript)
- Switch to the Developer perspective.
- Click the Project dropdown.
- Click Create Project.
- Enter the project name:
lab11-source-build
- Optional display name:
Lab 11 Source Build
- Click Create.
Option B: Create Project from CLI
Run:
oc new-project lab11-source-build
Code language: JavaScript (javascript)
Expected output:
Now using project "lab11-source-build" on server "https://api.crc.testing:6443".
Code language: JavaScript (javascript)
Verify:
oc project
Expected output:
Using project "lab11-source-build" on server "https://api.crc.testing:6443".
Code language: JavaScript (javascript)
Part 5: Import the Application from Git Using the Web Console
In the OpenShift web console:
- Make sure you are in the project:
lab11-source-build
- Switch to the Developer perspective.
- Click +Add.
- Under Git Repository, click From Git or Import from Git.
Depending on your OpenShift version, the label may appear as either:
From Git
or:
Import from Git
Code language: JavaScript (javascript)
Both refer to the same workflow.
Git Repository URL
In the Git repository URL field, enter:
https://github.com/redhat-developer-demos/sandbox-nodejs.git
Code language: JavaScript (javascript)
This is a simple Node.js application used for OpenShift S2I demonstration.
After entering the URL, OpenShift validates the repository.
Git Options
For this beginner lab, keep the default Git options.
| Field | Value |
|---|---|
| Git Repo URL | https://github.com/redhat-developer-demos/sandbox-nodejs.git |
| Git Reference | Leave blank |
| Context Dir | Leave blank |
| Source Secret | Leave blank |
Use Git Reference only when you want to build from a specific branch, tag, or commit.
Use Context Dir only when the application is inside a subdirectory of the Git repository.
Use Source Secret only when the Git repository is private.
Part 6: Select the Import Strategy
After the Git URL is validated, OpenShift tries to detect the correct build strategy.
For this lab, use:
Import Strategy: Builder Image
OpenShift should detect that the application is a Node.js application.
If it does not detect it automatically, select:
Builder Image: Node.js
Code language: CSS (css)
Use the latest available Node.js builder image version shown in your OpenShift web console.
The exact Node.js version available depends on your OpenShift Local version and sample image configuration.
For example, you might see versions such as:
Node.js 18
Node.js 20
Node.js 22
Code language: CSS (css)
Select the latest available stable version.
Part 7: Configure Application Details
Scroll down to the application configuration section.
Use the following values:
| Field | Value |
|---|---|
| Application Name | lab11-source-build |
| Name | sandbox-nodejs |
| Runtime Icon | Node.js |
| Builder Image | Node.js |
| Resource Type | Deployment |
If OpenShift auto-fills the names, you can keep the defaults as long as they are clear and unique.
For consistency in this lab, use:
Application Name: lab11-source-build
Name: sandbox-nodejs
Part 8: Configure Resources
In the Resources section, select:
Deployment
Do not select DeploymentConfig.
Why?
Because Deployment is the standard Kubernetes workload resource and is the preferred teaching choice for modern OpenShift labs.
Part 9: Create a Route
In the Advanced options section, make sure this option is enabled:
Create a route to the application
A Route gives the application a browser-accessible URL.
Without a Route, the application would still run inside the cluster, but you would not be able to open it easily from your browser.
Part 10: Create the Application
Review the form.
You should have:
| Setting | Expected Value |
|---|---|
| Project | lab11-source-build |
| Git Repo URL | https://github.com/redhat-developer-demos/sandbox-nodejs.git |
| Import Strategy | Builder Image |
| Builder Image | Node.js |
| Application Name | lab11-source-build |
| Name | sandbox-nodejs |
| Resource Type | Deployment |
| Create Route | Enabled |
Click:
Create
OpenShift now starts the build and deployment process.
Part 11: Watch the Build in the Web Console
After you click Create, OpenShift takes you to the Topology view.
You should see an application icon for:
sandbox-nodejs
During the build, the ring around the application may show a build or progress state.
Wait until the application is built and running.
This may take a few minutes on OpenShift Local.
Part 12: View Build Logs in the Web Console
To view the build logs:
- In Topology, click the
sandbox-nodejsapplication. - Look for the related build.
- Open the build details.
- Click Logs.
You should see OpenShift cloning the Git repository, installing dependencies, and assembling the application image.
Typical log stages include:
Cloning source code
Installing Node.js dependencies
Running S2I assemble process
Pushing image to internal registry
Build completed successfully
Code language: CSS (css)
Exact log text may differ depending on your builder image version.
Part 13: Verify the Application from the Web Console
In the Topology view:
- Wait until the application shows as running.
- Click the external link icon on the application.
- A browser tab should open.
- The Node.js application page should load.
If the page opens successfully, your source-code build and deployment worked.
Part 14: Verify Resources Using the CLI
Now validate the same result using the oc CLI.
Set the project:
oc project lab11-source-build
List the main resources:
oc get buildconfig,build,imagestream,deployment,pod,service,route
Code language: JavaScript (javascript)
You should see resources similar to:
buildconfig.build.openshift.io/sandbox-nodejs
build.build.openshift.io/sandbox-nodejs-1
imagestream.image.openshift.io/sandbox-nodejs
deployment.apps/sandbox-nodejs
pod/sandbox-nodejs-xxxxx
service/sandbox-nodejs
route.route.openshift.io/sandbox-nodejs
The exact pod and build names may be different.
Part 15: Check the BuildConfig
Run:
oc get bc
Code language: JavaScript (javascript)
Expected output:
NAME TYPE FROM LATEST
sandbox-nodejs Source Git 1
Describe the BuildConfig:
oc describe bc sandbox-nodejs
Look for:
Strategy: Source
Source: Git
Output to: ImageStreamTag sandbox-nodejs:latest
Code language: CSS (css)
This confirms that OpenShift created a source build configuration.
Part 16: Check the Build
List builds:
oc get builds
Code language: JavaScript (javascript)
Expected output:
NAME TYPE FROM STATUS STARTED DURATION
sandbox-nodejs-1 Source Git Complete ... ...
The build status should be:
Complete
View the build logs:
oc logs -f bc/sandbox-nodejs
If the build is already complete, this command still shows the latest BuildConfig logs.
You can also view logs for a specific build:
oc logs build/sandbox-nodejs-1
Part 17: Check the ImageStream
Run:
oc get imagestream
Code language: JavaScript (javascript)
Expected output:
NAME IMAGE REPOSITORY TAGS UPDATED
sandbox-nodejs default-route-openshift-image-registry.apps-crc.testing/... latest ...
Code language: JavaScript (javascript)
The ImageStream tracks the image produced by the build.
OpenShift uses this image to deploy the application.
Part 18: Check the Deployment
Run:
oc get deployment
Code language: JavaScript (javascript)
Expected output:
NAME READY UP-TO-DATE AVAILABLE AGE
sandbox-nodejs 1/1 1 1 ...
Check rollout status:
oc rollout status deployment/sandbox-nodejs
Expected output:
deployment "sandbox-nodejs" successfully rolled out
Code language: JavaScript (javascript)
Describe the Deployment:
oc describe deployment sandbox-nodejs
This shows the image, labels, pod template, replica count, and rollout status.
Part 19: Check the Pod
Run:
oc get pods
Code language: JavaScript (javascript)
Expected output:
NAME READY STATUS RESTARTS AGE
sandbox-nodejs-xxxxx 1/1 Running 0 ...
View pod logs:
oc logs deployment/sandbox-nodejs
Expected output may include Node.js or Express startup logs.
If the pod is not running, describe it:
oc describe pod -l app=sandbox-nodejs
Part 20: Check the Service
Run:
oc get svc
Code language: JavaScript (javascript)
Expected output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
sandbox-nodejs ClusterIP ... <none> 8080/TCP ...
Code language: HTML, XML (xml)
The Service provides stable internal access to the application inside the cluster.
The Service name is:
sandbox-nodejs
Inside the same project, other pods can reach the app using:
http://sandbox-nodejs:8080
Code language: JavaScript (javascript)
Part 21: Check the Route
Run:
oc get route
Code language: JavaScript (javascript)
Expected output:
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
sandbox-nodejs sandbox-nodejs-lab11-source-build.apps-crc.testing sandbox-nodejs 8080 None
The exact hostname may be different.
Store the route URL:
APP_URL="http://$(oc get route sandbox-nodejs -o jsonpath='{.spec.host}')"
echo "$APP_URL"
Code language: PHP (php)
Test the application:
curl -I "$APP_URL"
Code language: JavaScript (javascript)
Expected output should include:
HTTP/1.1 200 OK
Code language: HTTP (http)
If your application redirects or returns another successful HTTP response, that is also acceptable.
Open the URL in your browser:
http://<route-hostname>
Code language: HTML, XML (xml)
Part 22: Understand What Happened
When you clicked Create, OpenShift performed several actions automatically.
Step 1: OpenShift Pulled Source Code from Git
OpenShift cloned the repository:
https://github.com/redhat-developer-demos/sandbox-nodejs.git
Code language: JavaScript (javascript)
Step 2: OpenShift Selected a Builder Image
Because this is a Node.js application, OpenShift used a Node.js builder image.
Step 3: OpenShift Created a BuildConfig
The BuildConfig stores the build definition.
It tells OpenShift:
Where the source code is
Which builder image to use
Where to push the built image
What triggers future builds
Code language: PHP (php)
Step 4: OpenShift Started a Build
The Build object represents one execution of the build.
Example:
sandbox-nodejs-1
Step 5: OpenShift Created an ImageStream
The ImageStream tracks the resulting image.
The app Deployment points to the image produced by the build.
Step 6: OpenShift Created a Deployment
The Deployment created the running application pod.
Step 7: OpenShift Created a Service
The Service provides internal access to the pod.
Step 8: OpenShift Created a Route
The Route provides external browser access to the application.
Part 23: Trigger a New Build Manually
You can manually trigger a rebuild.
Run:
oc start-build sandbox-nodejs
Expected output:
build.build.openshift.io/sandbox-nodejs-2 started
Watch the build:
oc logs -f bc/sandbox-nodejs
List builds again:
oc get builds
Code language: JavaScript (javascript)
Expected output:
NAME TYPE FROM STATUS
sandbox-nodejs-1 Source Git Complete
sandbox-nodejs-2 Source Git Complete
This proves that the BuildConfig can be reused to produce a new application image.
Part 24: Scale the Application
Even though this lab focuses on building from source code, you can quickly verify that the result is a normal Kubernetes Deployment.
Scale to 2 pods:
oc scale deployment/sandbox-nodejs --replicas=2
Check pods:
oc get pods
Code language: JavaScript (javascript)
Expected result:
Two sandbox-nodejs pods should be running.
Scale back to 1 pod:
oc scale deployment/sandbox-nodejs --replicas=1
Check deployment:
oc get deployment sandbox-nodejs
Code language: JavaScript (javascript)
Expected result:
READY 1/1
Part 25: Optional CLI-Only Equivalent
The main lab uses the web console. However, it is useful to know the CLI equivalent.
To create a similar app from source code using the CLI, you could run:
oc new-app https://github.com/redhat-developer-demos/sandbox-nodejs.git --name=sandbox-nodejs
Code language: JavaScript (javascript)
Then expose it:
oc expose svc/sandbox-nodejs
Check the route:
oc get route sandbox-nodejs
Code language: JavaScript (javascript)
This is not the main method for this lab, but it helps students understand that the web console and CLI both create OpenShift resources.
Part 26: Student Validation Checklist
Students should confirm the following:
| Check | Command | Expected Result |
|---|---|---|
| Current project | oc project | lab11-source-build |
| BuildConfig exists | oc get bc | sandbox-nodejs |
| Build completed | oc get builds | Build status Complete |
| ImageStream exists | oc get is | sandbox-nodejs |
| Deployment ready | oc get deploy | 1/1 ready |
| Pod running | oc get pods | Pod status Running |
| Service exists | oc get svc | sandbox-nodejs |
| Route exists | oc get route | Route hostname created |
| Browser works | Open route URL | App page loads |
Part 27: Full Validation Commands
Run these commands after completing the lab:
oc project lab11-source-build
echo "Checking BuildConfig..."
oc get bc sandbox-nodejs
echo "Checking Builds..."
oc get builds
echo "Checking ImageStream..."
oc get imagestream sandbox-nodejs
echo "Checking Deployment..."
oc get deployment sandbox-nodejs
echo "Checking rollout status..."
oc rollout status deployment/sandbox-nodejs
echo "Checking Pods..."
oc get pods -l app=sandbox-nodejs
echo "Checking Service..."
oc get svc sandbox-nodejs
echo "Checking Route..."
oc get route sandbox-nodejs
echo "Getting app URL..."
APP_URL="http://$(oc get route sandbox-nodejs -o jsonpath='{.spec.host}')"
echo "$APP_URL"
echo "Testing app..."
curl -I "$APP_URL"
Code language: PHP (php)
Expected result:
- BuildConfig exists.
- Build status is
Complete. - ImageStream exists.
- Deployment is available.
- Pod is running.
- Service exists.
- Route exists.
curl -Ireturns an HTTP response.
Part 28: Troubleshooting
Problem 1: Git Repository URL Is Not Validated
Symptom
The web console does not validate the Git URL.
Possible Causes
- Internet connection issue.
- GitHub is blocked by network policy or firewall.
- Typo in the repository URL.
- OpenShift Local VM cannot reach GitHub.
Fix
Check the URL:
https://github.com/redhat-developer-demos/sandbox-nodejs.git
Code language: JavaScript (javascript)
Try opening the repository in your browser.
From CLI, check whether your OpenShift Local cluster is running:
crc status
Problem 2: Builder Image Is Not Detected
Symptom
OpenShift does not automatically detect Node.js.
Possible Causes
- Builder images are not available in your local OpenShift environment.
- The Cluster Samples Operator did not install sample image streams.
- The Git repository was not detected properly.
Fix
In the Import from Git page, manually select:
Import Strategy: Builder Image
Builder Image: Node.js
Code language: CSS (css)
If Node.js is not available, ask the instructor to check cluster sample image streams.
The instructor can check:
oc get imagestream -n openshift | grep -i node
Code language: JavaScript (javascript)
If no Node.js image stream exists, the OpenShift Local sample image configuration may need review.
Problem 3: Build Fails During npm Install
Symptom
The build starts but fails while installing Node.js dependencies.
Possible Causes
- Network issue while downloading npm packages.
- Temporary npm registry issue.
- Resource constraints in OpenShift Local.
- Builder image issue.
Fix
Check build logs:
oc logs -f bc/sandbox-nodejs
Check build status:
oc get builds
Code language: JavaScript (javascript)
Describe the failed build:
oc describe build sandbox-nodejs-1
Try the build again:
oc start-build sandbox-nodejs
Problem 4: Pod Is Not Running
Symptom
The build succeeds, but the pod does not become ready.
Fix
Check pods:
oc get pods
Code language: JavaScript (javascript)
Describe the pod:
oc describe pod -l app=sandbox-nodejs
Check logs:
oc logs deployment/sandbox-nodejs
Common causes:
- Application startup error.
- Wrong runtime port.
- Insufficient memory.
- Image pull issue.
- CrashLoopBackOff.
Problem 5: Route Opens but Browser Shows Error
Symptom
The route exists, but the application page does not load.
Fix
Check the route:
oc get route sandbox-nodejs
Code language: JavaScript (javascript)
Check the service:
oc get svc sandbox-nodejs
Code language: JavaScript (javascript)
Check endpoints:
oc get endpoints sandbox-nodejs
Code language: JavaScript (javascript)
If endpoints are empty, the Service is not pointing to a running pod.
Check pod labels:
oc get pods --show-labels
Code language: JavaScript (javascript)
Check service selector:
oc describe svc sandbox-nodejs
Problem 6: curl Does Not Work Locally
Symptom
The browser works but local curl fails, or curl works but browser fails.
Possible Causes
- DNS issue on local machine.
- Browser proxy or VPN issue.
- CRC networking issue.
- Application not ready yet.
Fix
Check CRC status:
crc status
Print route:
oc get route sandbox-nodejs
Code language: JavaScript (javascript)
Try again after a minute.
Problem 7: BuildConfig Not Found
Symptom
This command fails:
oc get bc sandbox-nodejs
Code language: JavaScript (javascript)
Possible Causes
- You are in the wrong project.
- The application name is different.
- The import failed.
- The web console created resources with a different name.
Fix
Check current project:
oc project
Switch to the correct project:
oc project lab11-source-build
List all BuildConfigs:
oc get bc
Code language: JavaScript (javascript)
List all resources:
oc get all
Code language: JavaScript (javascript)
Part 29: Cleanup
You can delete the application only, or delete the whole project.
For a lab environment, deleting the whole project is easiest.
Cleanup from Web Console
- Switch to the Developer perspective.
- Open the project:
lab11-source-build
- Go to Topology.
- Right-click the
sandbox-nodejsapplication. - Select Delete Application.
- Confirm the deletion.
This removes the application resources but may not remove every project-level object.
Cleanup from CLI
Delete the whole project:
oc delete project lab11-source-build
Code language: JavaScript (javascript)
Verify:
oc get project lab11-source-build
Code language: JavaScript (javascript)
Expected result:
Error from server (NotFound): projects.project.openshift.io "lab11-source-build" not found
Code language: JavaScript (javascript)
Part 30: Lab Summary
In this lab, you built and deployed an application from source code using the OpenShift web console.
You learned that OpenShift can:
- Pull source code from Git.
- Detect or use a builder image.
- Build a runnable container image using S2I.
- Store the built image in an ImageStream.
- Deploy the image as a Kubernetes Deployment.
- Run the application in a Pod.
- Expose the application internally using a Service.
- Expose the application externally using a Route.
- Allow rebuilds using a BuildConfig.
Part 31: Review Questions
Question 1
What is the purpose of Source-to-Image?
Answer
Source-to-Image builds a runnable container image by combining application source code with a builder image.
Question 2
What does a BuildConfig do?
Answer
A BuildConfig defines how OpenShift should build an application, including the source repository, build strategy, builder image, triggers, and output image.
Question 3
What is the purpose of an ImageStream?
Answer
An ImageStream tracks container images inside OpenShift and allows OpenShift resources to refer to images using tags such as latest.
Question 4
Why did we choose Deployment instead of DeploymentConfig?
Answer
Deployment is the standard Kubernetes workload resource and is the better choice for modern beginner labs.
Question 5
What is the purpose of a Service?
Answer
A Service provides stable internal network access to application pods.
Question 6
What is the purpose of a Route?
Answer
A Route exposes an application outside the OpenShift cluster using a browser-accessible hostname.
Question 7
Which command shows the latest build logs from a BuildConfig?
Answer
oc logs -f bc/sandbox-nodejs
Question 8
Which command manually triggers a new build?
Answer
oc start-build sandbox-nodejs
Question 9
Which command shows the external application URL?
Answer
oc get route sandbox-nodejs
Code language: JavaScript (javascript)
Question 10
Which command deletes the whole lab project?
Answer
oc delete project lab11-source-build
Code language: JavaScript (javascript)
Part 32: Instructor Notes
This lab is designed as a modern replacement for older OpenShift source-code build labs.
The old lab flow was based on Developer Sandbox. This replacement uses OpenShift Local so that students can practice locally.
This lab intentionally uses:
Deployment
instead of:
DeploymentConfig
This is better for students because it aligns with standard Kubernetes workload concepts.
The lab also uses a simple Node.js Git repository so students can focus on the OpenShift build process rather than database setup, application debugging, or complex runtime dependencies.
For a more advanced course, follow-up labs can cover:
- Building from a Dockerfile.
- Building from a private Git repository.
- Using source clone secrets.
- Using Git webhooks.
- Setting build triggers.
- Setting build CPU and memory limits.
- Rolling back deployments.
- Using OpenShift Pipelines.
- Using GitOps.
- Deploying multi-service applications.
Part 33: Instructor Pre-Validation Checklist
Before giving this lab to students, the instructor should run:
crc version
crc status
oc version
oc whoami
oc get nodes
Code language: JavaScript (javascript)
Check that the developer user can create projects:
oc auth can-i create projects
Check that Node.js builder image streams are available:
oc get imagestream -n openshift | grep -i node
Code language: JavaScript (javascript)
Create a test project:
oc new-project lab11-source-build-test
Code language: JavaScript (javascript)
Optionally test the CLI equivalent:
oc new-app https://github.com/redhat-developer-demos/sandbox-nodejs.git --name=sandbox-nodejs
oc expose svc/sandbox-nodejs
oc rollout status deployment/sandbox-nodejs
oc get route sandbox-nodejs
Code language: JavaScript (javascript)
Test the route:
APP_URL="http://$(oc get route sandbox-nodejs -o jsonpath='{.spec.host}')"
curl -I "$APP_URL"
Code language: JavaScript (javascript)
Clean up:
oc delete project lab11-source-build-test
Code language: JavaScript (javascript)
If these checks pass, the lab is ready for students.
Final Outcome
You have successfully built and deployed an application from source code using the OpenShift web console.
You now understand the complete OpenShift source-build workflow:
Git Repository
-> Source-to-Image Build
-> BuildConfig
-> Build
-> ImageStream
-> Deployment
-> Pod
-> Service
-> Route
-> Browser
This is one of the most important OpenShift developer workflows because it allows developers to go from source code to a running application without manually writing a container image build command.
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 does a good job of introducing source-based builds in OpenShift, but it could also explore the challenges teams face after the initial setup. In larger environments, build performance, dependency management, and regular security scans become important for maintaining efficient pipelines. It would also be helpful to discuss how source builds can be integrated with GitOps workflows and automated promotion processes to ensure that the same tested artifacts move reliably through development, staging, and production environments.