This guide assumes you already have OpenShift Local (formerly CRC) installed and running on your macOS or Linux machine. Now it’s time to level up your OpenShift skills with advanced, hands-on workflows designed to mimic real-world cluster usage.
โ Overview of What You’ll Learn
- Creating and Managing Projects
- Deploying Applications with Templates and Helm
- Configuring Routes and Services
- Working with Persistent Storage (PVC, PV)
- CI/CD Pipelines using OpenShift Pipelines (Tekton)
- Managing Secrets and ConfigMaps
- Resource Limits, Quotas, and Requests
- Monitoring and Logging with built-in tools
- Role-Based Access Control (RBAC)
- GitOps (Optional Bonus)
๐ฏ 1. Create and Manage Projects (Namespaces)
oc new-project dev-project
oc get projects
Code language: JavaScript (javascript)
Explanation:
- Projects are isolated Kubernetes namespaces with OpenShift-specific metadata.
- Use them to separate development, staging, and production workloads.
๐ 2. Deploy Applications via Templates or Helm
Option A: Using OpenShift Templates
oc new-app --name=my-nginx nginx
Code language: JavaScript (javascript)
Option B: Using Helm Charts (if Helm is enabled)
helm repo add bitnami https://charts.bitnami.com/bitnami
helm install my-mysql bitnami/mysql
Code language: JavaScript (javascript)
Scenario: Deploy a frontend-backend app using templates or Helm.
๐ 3. Expose Applications with Routes
oc expose svc/my-nginx
Explanation:
- This creates an OpenShift Route, which exposes a service to the external world.
- Use this for browser access to your apps.
๐พ 4. Work with Persistent Volumes (PVC/PV)
Create PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
oc apply -f pvc.yaml
Code language: CSS (css)
Scenario: Use this PVC in a deployment for MySQL/Postgres persistence.
๐ 5. Build CI/CD with OpenShift Pipelines (Tekton)
oc apply -f https://raw.githubusercontent.com/tektoncd/pipeline/main/examples/v1beta1/taskruns/taskrun.yaml
Code language: JavaScript (javascript)
Scenario:
- Build and deploy from GitHub automatically using
Pipeline,Task,TaskRunresources. - Use
TriggersandEventListenersto integrate with GitHub Webhooks.
๐ 6. Manage Secrets and ConfigMaps
oc create secret generic db-secret --from-literal=username=admin --from-literal=password=redhat
oc create configmap app-config --from-literal=theme=dark
Code language: JavaScript (javascript)
Use in Deployments:
envFrom:
- secretRef:
name: db-secret
- configMapRef:
name: app-config
๐ฆ 7. Configure Quotas and Limits
oc create quota mem-cpu-quota --hard=cpu=2,memory=4Gi,pods=10
Scenario: Prevent developers from consuming all cluster resources.
๐ 8. Monitor and Log
View Pod Logs
oc logs <pod-name>
Code language: HTML, XML (xml)
View Cluster Console Metrics
- Navigate to
https://console-openshift-console.apps-crc.testing/โ Observe dashboards. - View memory, CPU, and event logs per namespace or pod.
๐ฅ 9. Role-Based Access Control (RBAC)
oc create role dev-reader --verb=get,list --resource=pods
oc create rolebinding dev-binding --role=dev-reader --user=developer
Code language: JavaScript (javascript)
Scenario: Allow a user to only read pod data in a project.
๐ 10. GitOps (Optional Advanced Scenario)
- Install Argo CD Operator
- Connect Argo CD to a Git repository
- Sync deployments automatically from Git
oc apply -f argo-install.yaml
Code language: CSS (css)
Use Case: Fully automate application deployments with Git versioning and drift detection.
โ Summary
This advanced OpenShift Local workflow is ideal for developers, DevOps engineers, and learners who want to:
- Simulate real-world Kubernetes workloads
- Learn GitOps and CI/CD pipelines
- Understand the essentials of secure and scalable OpenShift development
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals