Updated for OpenShift 4.14+
This tutorial helps you practice real-world OpenShift workflows locally using CRC.
Step 1: Login to the Web Console and CLI
Web Console
crc console --credentials
Copy the admin URL and kubeadmin
credentials β open in browser.
CLI
eval $(crc oc-env)
oc login -u kubeadmin -p <password> --insecure-skip-tls-verify
Step 2: Understand Projects (Namespaces)
List All Projects:
oc get projects
Create Your Own:
oc new-project demo-app
Step 3: Deploy Your First Application
Using CLI (quickstart):
oc new-app nginx
Expose it:
oc expose svc/nginx
Get Route:
oc get route
Test in browser using the exposed route.
Step 4: Work with the Developer Console
- Go to the Web Console β Developer View
- Switch to
demo-app
project - Click +Add β Use βContainer Imageβ
- Search for image like
node:latest
,php:8.2-apache
, orquay.io/...
This gives visual understanding of how apps, builds, and deployments connect.
Step 5: Build from Source (Git to Deployment)
Deploy from Git (Node.js example):
oc new-app https://github.com/sclorg/nodejs-ex.git
Monitor:
oc get builds
oc logs -f bc/nodejs-ex
Access:
oc expose svc/nodejs-ex
oc get route
Step 6: Scale Applications
Increase Pods:
oc scale --replicas=3 deployment/nginx
Check Pods:
oc get pods -o wide
Step 7: Access Pod Shell & Logs
oc rsh <pod-name>
oc logs <pod-name>
Use this for debugging and viewing container state.
Step 8: Set Resource Limits
oc set resources deployment nginx \
--limits=cpu=500m,memory=256Mi \
--requests=cpu=200m,memory=128Mi
Step 9: Understand and Apply YAML
- Export a deployment:
oc get deployment nginx -o yaml > nginx.yaml
- Edit and apply:
oc apply -f nginx.yaml
Step 10: Use Secrets and ConfigMaps
Create ConfigMap:
oc create configmap app-config --from-literal=ENV=prod
Create Secret:
oc create secret generic app-secret --from-literal=DB_PASS=admin123
Mount or Inject via ENV in deployment YAML.
Step 11: OpenShift Pipelines (Tekton)
- In OperatorHub, install OpenShift Pipelines Operator
- Create:
- PipelineResource
- Task
- Pipeline
- Use the developer consoleβs Pipelines view to build CI/CD
Step 12: Monitor with Web UI
- Use Observe β Metrics
- View Dashboard, Topology, and Builds
- Use Pod terminal from console
Step 13: Delete a Project
oc delete project demo-app
Bonus Tips:
Feature | CLI Command |
---|---|
List all Pods | oc get pods |
View events | oc get events |
Port Forward | oc port-forward svc/nginx 8080:80 |
RoleBinding | oc adm policy add-role-to-user admin developer |
Enable Dev View | Use toggle in OpenShift console UI |
Practice Ideas:
- Deploy a multi-container app with
mysql
+wordpress
- Create blue-green deployments
- Use Tekton pipeline to auto-deploy from GitHub
Iβm a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights 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 I reviewed , and SEO strategies at Wizbrand.
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 PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND