OpenShift Fundamentals

Learn Red Hat OpenShift fundamentals including architecture, projects, pods, deployments, routes, services, operators, ImageStreams, BuildConfigs, Security Context Constraints, CI/CD, and production-ready concepts.

Introduction

Red Hat OpenShift is an enterprise Kubernetes platform that simplifies containerized application development, deployment, scaling, and management.

While Kubernetes provides the core container orchestration capabilities, OpenShift extends Kubernetes with enterprise-grade features such as:

  • Integrated CI/CD
  • Built-in Image Registry
  • Operators
  • Enhanced Security
  • Developer Console
  • Routes
  • Build Automation
  • Monitoring
  • Logging

Today, OpenShift is widely used across banking, insurance, healthcare, retail, and government organizations to run mission-critical applications.

This guide introduces the fundamental OpenShift concepts required for enterprise development and DevOps interviews.


Learning Objectives

After completing this guide, you'll understand:

  • What is OpenShift?
  • OpenShift Architecture
  • Kubernetes vs OpenShift
  • OpenShift Components
  • Projects
  • Pods
  • Deployments
  • Services
  • Routes
  • ImageStreams
  • BuildConfigs
  • DeploymentConfig
  • Operators
  • Security Context Constraints (SCC)
  • OpenShift CLI (oc)
  • CI/CD Integration
  • Production Best Practices

What is OpenShift?

OpenShift is a Kubernetes-based container platform developed by Red Hat.

It provides:

  • Container orchestration
  • Developer platform
  • DevOps automation
  • Enterprise security
  • Monitoring
  • Logging
  • CI/CD integration

Why OpenShift?

Traditional deployments require:

  • Manual server setup
  • Manual scaling
  • Manual deployments
  • Manual security
  • Manual monitoring

Problems

  • Slow deployments
  • Human errors
  • Downtime
  • Difficult scaling

OpenShift Workflow

flowchart LR

Developer --> GitRepositoryBuildImagestream["Git Repository --> Build --> ImageStream --> Deployment --> Pods --> Service --> Route --> Users"]

Kubernetes vs OpenShift

Kubernetes OpenShift
Open Source Enterprise Platform
Basic Dashboard Developer Console
Manual CI/CD Built-in CI/CD Integration
Ingress Routes
RBAC Enhanced RBAC + SCC
Community Support Enterprise Support

OpenShift Architecture

flowchart TD

Developer --> API

API --> Master

Master --> Worker1

Master --> Worker2

Master --> Worker3

Worker1-->Pods
Worker2-->Pods
Worker3-->Pods

OpenShift Components

  • Control Plane
  • Worker Nodes
  • API Server
  • Scheduler
  • etcd
  • Controller Manager
  • Ingress Controller
  • Image Registry

Projects (Namespaces)

Projects isolate applications.

Example

Development

Testing

Production

Benefits

  • Security
  • Resource Isolation
  • RBAC

Pods

Pods are the smallest deployable units.

One pod can contain

  • One Container
  • Multiple Containers

Deployments

Deployment manages

  • ReplicaSets
  • Rolling Updates
  • Self-Healing
  • Scaling

DeploymentConfig

OpenShift-specific deployment resource.

Supports

  • Image Change Trigger
  • Config Change Trigger
  • Rollback

Services

Services expose Pods internally.

Types

  • ClusterIP
  • NodePort
  • LoadBalancer

Routes

OpenShift Route exposes applications externally.

flowchart LR

User --> Route --> Service --> Pods

Unlike Kubernetes Ingress, Routes are built into OpenShift.


ImageStreams

ImageStreams track container image versions.

Benefits

  • Image Versioning
  • Automatic Deployments
  • Rollbacks

BuildConfig

Automates image builds.

Supported Strategies

  • Source-to-Image (S2I)
  • Docker Build
  • Custom Build

Source-to-Image (S2I)

S2I builds application images directly from source code.

Pipeline

flowchart LR

Git --> Source --> S2I --> Image --> Registry

Operators

Operators automate application lifecycle.

Responsibilities

  • Install
  • Upgrade
  • Scale
  • Backup
  • Restore

Examples

  • PostgreSQL Operator
  • Kafka Operator
  • Prometheus Operator

Security Context Constraints (SCC)

SCC controls

  • User Permissions
  • Container Privileges
  • Root Access
  • Volumes
  • Capabilities

OpenShift is more secure than vanilla Kubernetes because containers do not run as root by default.


OpenShift CLI

Common commands

oc login

oc project

oc get pods

oc get deployments

oc get svc

oc get routes

oc logs

oc describe pod

oc apply -f deployment.yaml

oc delete pod

Scaling Applications

flowchart LR

Deployment --> 1Pod --> 3Pods --> 10Pods

Scaling can be:

  • Manual
  • Horizontal Pod Autoscaler
  • Cluster Autoscaler

Rolling Updates

flowchart LR

Version1 --> Version1+Version2 --> MostlyVersion2 --> Version2

Benefits

  • Zero Downtime
  • Automatic Rollback

OpenShift CI/CD

Typical pipeline

flowchart LR

GitHub --> Jenkins --> BuildConfig --> ImageStream --> DeploymentConfig --> OpenShift

Monitoring

OpenShift includes

  • Prometheus
  • Grafana
  • Alertmanager

Monitor

  • CPU
  • Memory
  • Pod Health
  • Node Health
  • Application Metrics

Logging

Centralized logging

  • Loki
  • Elasticsearch
  • Kibana
  • Fluentd

Production Best Practices

Security

  • Least Privilege
  • SCC
  • RBAC
  • Secrets
  • Network Policies

Deployments

  • Rolling Updates
  • Health Checks
  • Readiness Probes
  • Liveness Probes

Images

  • Small Images
  • Image Scanning
  • Immutable Tags

Monitoring

  • Alerts
  • Dashboards
  • Metrics
  • Logs

Common OpenShift Resources

Resource Purpose
Project Namespace
Pod Running Containers
Deployment Application Deployment
Service Internal Networking
Route External Access
ImageStream Image Versioning
BuildConfig Image Build
DeploymentConfig OpenShift Deployment
Operator Application Lifecycle

Real-World Example

A developer pushes a Spring Boot application to GitHub.

  1. Jenkins pipeline is triggered.
  2. BuildConfig compiles the application using Source-to-Image (S2I).
  3. The generated image is stored in an ImageStream.
  4. DeploymentConfig detects the new image.
  5. OpenShift performs a rolling update.
  6. Pods pass readiness and liveness probes.
  7. Services route internal traffic.
  8. Routes expose the application externally.
  9. Prometheus monitors application health.
  10. Grafana dashboards display metrics, and Alertmanager sends notifications if thresholds are exceeded.

Interview Tips

Remember these keywords:

  • OpenShift = Enterprise Kubernetes
  • Project = Namespace
  • Route = External Access
  • Service = Internal Access
  • Pod = Smallest Deployable Unit
  • Deployment = Replica Management
  • ImageStream = Image Versioning
  • BuildConfig = Build Automation
  • DeploymentConfig = OpenShift Deployment
  • Operator = Automated Lifecycle
  • SCC = Enhanced Security
  • oc = OpenShift CLI

Summary

OpenShift builds on Kubernetes by adding enterprise-grade capabilities such as integrated CI/CD, enhanced security, ImageStreams, BuildConfigs, Routes, Operators, and developer-friendly tooling.

Mastering these concepts provides a solid foundation for working with OpenShift in production environments and prepares you for Red Hat OpenShift certifications, enterprise DevOps roles, Platform Engineering, Site Reliability Engineering (SRE), and Solution Architect interviews.

In the next chapter, you'll explore OpenShift Advanced, including Operators, GitOps, Helm, ArgoCD, OpenShift Pipelines (Tekton), Service Mesh, Multi-Cluster Management, Security, Observability, and enterprise production architectures.