OpenShift Container Platform (OCP)
What is OCP?
An enterprise Kubernetes platform with additional security, CI/CD,
monitoring, and developer features.
Kubernetes + Enterprise Security + Developer Tools + CI/CD + Monitoring
Deployment Platforms
- On-Premises
- AWS
- Azure
- Hybrid Cloud
Part 1: OCP Architecture for Java Microservices
High-Level Architecture Flow
Users (Web / Mobile)
¦
?
External DNS
¦
?
OCP Router (Ingress Controller)
¦
?
OpenShift Cluster
+-- API Gateway Pod
+-- Auth Service (JWT)
+-- User Service
+-- Order Service
+-- Kafka Consumers
+-- Redis
¦
?
PostgreSQL / MySQL
OCP Core Components
Master Nodes (Control Plane)
- API Server
- Scheduler
- Controller Manager
- etcd (Cluster State)
Worker Nodes
- Pods
- Containers
- Java Microservices
Pods
Smallest deployable unit.
- Auth Service Pod
- Order Service Pod
Each pod contains:
- Spring Boot Container
- Sidecar Container (Optional)
Deployment / DeploymentConfig
Defines:
- Replica Count
- Container Image Version
- Rolling Updates
Example:
Replicas: 3
Image: auth-service:1.0
Services
Internal communication between microservices.
- ClusterIP
- NodePort
- LoadBalancer
Example:
http://user-service:8080/api/users
Routes (OpenShift Specific)
OpenShift uses Route instead of Kubernetes Ingress.
https://auth.apps.ocp.company.com
OCP Security
Security Context Constraints (SCC)
- No root containers by default
- Strict security enforcement
RBAC
- Role Based Access Control
- Project-level isolation
Network Architecture
Request Flow Example:
https://api.company.com/orders
Step 1: DNS
External DNS resolves to OCP Router.
Step 2: Router (HAProxy)
- Handles SSL
- Routes traffic
- Path-based routing
Example:
/auth ? Auth Service
/orders ? Order Service
Step 3: Service (ClusterIP)
Load balances requests to pods.
Step 4: Pod Processing
- JWT Validation
- Microservice Calls
- Database Access
Step 5: Database
- StatefulSet
- External Managed Database
Scaling in OCP
Manual Scaling
oc scale deployment auth-service --replicas=5
HPA (Horizontal Pod Autoscaler)
- CPU-based scaling
- Memory-based scaling
- Custom metrics scaling
High Availability
- Multiple Worker Nodes
- Replica Pods
- Multi-Zone Clusters
- Pod Anti-Affinity
Fault Tolerance
- Replica Pods
- Liveness Probes
- Readiness Probes
- Self-Healing Pods
- Rolling Updates
Enterprise Features
Operators
- PostgreSQL Operator
- Kafka Operator
CI/CD
Built-in Tekton Pipelines
Git Push
?
Build
?
ImageStream
?
Deploy
ImageStreams
Tracks container images in OCP Registry.
Projects (Namespaces)
Monitoring Stack
- Prometheus
- Grafana
- AlertManager
OCP vs AWS
| Feature |
OCP |
AWS |
| Networking |
Route |
ALB |
| Security |
SCC |
Security Groups |
| CI/CD |
Built-in |
Separate Services |
| Registry |
Internal Registry |
ECR |
Production High Availability Strategy
| Layer |
HA Strategy |
| Router |
2+ Replicas |
| API Gateway |
2+ Replicas |
| Microservices |
3+ Replicas |
| Database |
Replication |
| Kafka |
3 Brokers |
| Redis |
Master + Replica |
| Worker Nodes |
3+ Nodes |
Senior-Level Interview Questions
- Difference between Route and Ingress?
- What is SCC?
- How does OCP ensure pod security?
- How does rolling deployment work?
- What happens if a worker node crashes?
- How do you implement zero downtime deployment?
- How do you manage secrets in OCP?
- How do you isolate dev/qa/prod environments?
Important Resilience Topics
- Pod Failure Recovery
- Node Failure Recovery
- Database Failover
- HPA Auto Scaling
- Circuit Breaker Integration
- Gremlin Chaos Testing
- Failure Mode Analysis (FMA)
Reference
This HTML document was generated from the uploaded OCP Architecture notes. :contentReference[oaicite:0]{index=0}