OpenShift — Interview Questions
Real questions from enterprise OCP interviews — telecom, banking, cloud-native production, banking production experience with OCP 4.14-4.16.
OpenShift Core Concepts
What is OpenShift?
Red Hat OpenShift Container Platform (OCP) is an enterprise Kubernetes distribution — Kubernetes underneath, but with everything enterprises actually need already built in: built-in HAProxy Router (Routes), integrated OAuth server, Security Context Constraints (SCCs) for pod-level security, built-in Prometheus/Alertmanager monitoring, internal image registry, Operator Lifecycle Manager (OLM), and the Cluster Version Operator (CVO) for managed upgrades. The CLI is oc — a superset of kubectl. Used heavily in telecom (5G, NFV), banking, healthcare, and government environments.
What is the difference between Kubernetes and OpenShift?
| Feature | Kubernetes | OpenShift |
|---|
|---|---|---|
| Ingress | Kubernetes Ingress (needs controller) | Routes (HAProxy built-in) |
|---|---|---|
| Security | Basic RBAC | RBAC + SCCs |
| Auth | External IdP only | Built-in OAuth (HTPasswd, LDAP, OIDC) |
| CLI | kubectl | oc (superset — all kubectl commands work) |
| Monitoring | Optional add-on | Built-in Prometheus + Alertmanager |
| Updates | Manual | Managed by Cluster Version Operator |
| Builds | External CI | BuildConfig + ImageStream built-in |
| Registry | External only | Integrated Internal Registry |
| Developer Portal | None | Web Console with topology view |
Key phrase for interviews: "OpenShift is Kubernetes with enterprise guardrails — security, observability, and developer experience baked in rather than bolted on."
What are OpenShift built-in components?
Routes and Networking
What are Routes in OpenShift?
Routes are OCP's native HTTP/HTTPS routing resource — the equivalent of Kubernetes Ingress but built on HAProxy which comes pre-configured in OCP via the Ingress Operator. Routes expose services externally with a hostname: http://myapp-myproject.apps.. They support three TLS modes: Edge, Passthrough, and Reencrypt.
What is the difference between Route and Ingress?
Kubernetes Ingress is a standard API resource but requires a separately installed controller (Nginx, Traefik, HAProxy) to function — it does nothing out of the box. OpenShift Route is OCP's native equivalent with HAProxy pre-installed and running. Routes support three TLS modes; Ingress only supports edge termination natively. OCP also accepts standard Kubernetes Ingress objects — it converts them to Routes internally. For OCP-specific work, always use Routes.
Route TLS termination types:
| Type | TLS terminates at | Traffic to Pod | Use when |
|---|
|---|---|---|---|
| Edge | HAProxy Router | HTTP (plain) | SSL offloading at LB |
|---|---|---|---|
| Passthrough | Pod itself | TLS end-to-end | Database, mTLS required |
| Reencrypt | Router, then re-encrypted | TLS (different cert) | Compliance: encrypt everywhere |
Security Context Constraints (SCCs)
What is SCC (Security Context Constraints)?
SCCs are OCP-specific security policies that control what a pod is allowed to do at the OS level — whether it can run as root, use privileged mode, access host networking, mount host paths, or use specific volume types. Every pod gets an SCC assigned at admission time. The default restricted SCC prevents running as root and applies to all pods automatically. This is the most common source of failures when migrating workloads from vanilla Kubernetes to OCP — images that run as root on K8s fail the restricted SCC on OCP.
SCC hierarchy (most to least restrictive):
Most common SCC error:
Fix: oc adm policy add-scc-to-user anyuid -z default -n
Pods, Services, Deployments
What are Pods, Services, Deployments in OpenShift?
These are standard Kubernetes objects that work identically in OCP:
..svc.cluster.local ). Routes traffic to pods matching its selector. Types: ClusterIP (internal), NodePort, LoadBalancer.What happens when you update a deployment?
When you change a Deployment (new image, env var, resource limits), Kubernetes/OCP:
maxSurge (how many extra pods allowed) and maxUnavailable (how many can be down)readinessProbe to pass before routing traffic to new podsWhat is a rolling update?
Rolling update replaces pods one by one (or in batches) without downtime. The critical settings:
With maxUnavailable: 0, you always have full capacity. New pod must pass readinessProbe before old pod is terminated. Without readinessProbe, traffic hits pods before they're ready — users see errors.
Difference between Deployment and ReplicaSet?
ReplicaSet ensures N copies of a pod are running — it's a low-level controller. Deployment manages ReplicaSets — it creates a new ReplicaSet on every update, keeps old ones for rollback history, and handles the rolling update process. You always create Deployments, never ReplicaSets directly. kubectl rollout undo switches traffic back to the previous ReplicaSet.
What is a namespace / project?
Namespace is Kubernetes' way of dividing cluster resources into isolated groups. In OpenShift, a Project is a namespace with additional metadata (display name, description, requester annotation). Projects get automatically configured with: default network policies, LimitRanges, ResourceQuotas. Use projects to isolate teams, environments (dev/staging/prod), and applications from each other.
Storage — PVC and StorageClass
What is PVC and StorageClass?
PersistentVolumeClaim (PVC) is a request for storage from a pod — size, access mode, storage class. StorageClass defines how storage is provisioned (which backend, what performance tier, what reclaim policy). When a PVC is created with a StorageClass, the CSI driver dynamically provisions a PersistentVolume (PV) automatically.
What storage options are used in OCP? (Ceph, Portworx)
| Storage | Type | Access Modes | Use Case |
|---|
|---|---|---|---|
| **Ceph (ODF)** | Software-defined | RWO, RWX, ROX | Default in OCP on-prem, RWX for VMs live migration |
|---|---|---|---|
| Portworx | Software-defined | RWO, RWX | High-performance, enterprise SLA |
| AWS EBS (gp3) | Cloud block | RWO only | EC2/EKS/ROSA workloads |
| AWS EFS | Cloud file | RWX | Shared storage on AWS |
| Azure Disk | Cloud block | RWO only | AKS/ARO workloads |
| Azure Files | Cloud file | RWX | Shared storage on Azure |
| NFS | File | RWX | On-prem simple shared storage |
How dynamic provisioning works:
RWO vs RWX — the critical difference:
Jenkins on Kubernetes/OpenShift
How Jenkins runs pipelines on Kubernetes?
Jenkins uses the Kubernetes Plugin to dynamically create pods as build agents. Each pipeline run gets a fresh pod, runs the stages, then the pod is deleted. This gives: infinite scalability (pods created on demand), isolation (each build in its own pod), and clean environments (no residual state).
What is the Kubernetes plugin in Jenkins?
The Kubernetes Plugin connects Jenkins to a Kubernetes/OCP cluster and enables dynamic pod agents. Configure it in Jenkins: Manage Jenkins → Configure System → Cloud → Kubernetes. You specify: cluster API URL, credentials, namespace, and pod templates. Pod templates define what containers run in the agent pod.
What is a JNLP container?
JNLP (Java Network Launch Protocol) container is the mandatory sidecar in every Jenkins agent pod. It runs the Jenkins remoting agent that connects back to the Jenkins master and receives pipeline commands. Every Jenkins pod has: a jnlp container (handles Jenkins communication) + your build containers (maven, docker, kubectl, etc.). You don't need to configure the JNLP container — Jenkins injects it automatically.
What happens when a pipeline is triggered?
agent { kubernetes { ... } } blockjnlp container connects back to Jenkins masterHow Jenkins creates dynamic pods?
Via the Kubernetes plugin pod template in Jenkinsfile:
How to configure Jenkins with OpenShift?
How to troubleshoot Jenkins pipeline failure?
What happens if Jenkins pod is in Pending state?
GitOps with ArgoCD
What is GitOps?
GitOps means Git is the single source of truth for what should run in the cluster. Every change — new image, config update, resource limit change — goes through a Git pull request. No one runs oc apply directly in production. An operator (ArgoCD) continuously watches Git and reconciles the cluster to match. Benefits: full audit trail (git log), instant rollback (git revert), reproducible environments, drift detection.
How ArgoCD works?
ArgoCD is installed via the OpenShift GitOps Operator. It runs in openshift-gitops namespace. Access: oc get route openshift-gitops-server -n openshift-gitops.
What is Sync vs OutOfSync in ArgoCD?
Manual sync vs auto sync?
Without automated: ArgoCD detects changes but you must click Sync manually or run argocd app sync myapp. With automated: ArgoCD applies changes immediately when Git changes, and reverts drift. For production: use auto-sync with approval gates on the Git repository (PR reviews, branch protection). For critical databases: manual sync is safer.
ArgoCD auto sync additional options:
What is drift in ArgoCD?
Drift is when the actual cluster state differs from Git. Caused by: manual oc apply, manual oc edit, auto-scaling changing replica counts, mutation webhooks changing resources. With selfHeal: true, ArgoCD detects and reverts drift within the sync interval. Without selfHeal, drift is only reported, not fixed. In a large enterprise telecom org, selfHeal was enabled for all production apps — any manual change was automatically reverted within 3 minutes.
Image Push → Deployment Flow
How deployment happens after image is pushed to Quay?
In a large telecom deployment, the full flow was:
What tools are involved after Quay push?
How ArgoCD ensures cluster matches Git?
ArgoCD runs a reconciliation loop (default every 3 minutes, or triggered by webhook). Each loop: fetch Git repo HEAD, fetch current cluster resources, compute diff, if diff exists and auto-sync enabled → apply changes. The comparison uses server-side dry-run to detect what would change.
What if image is not updated in deployment?
If I change YAML, will it reflect automatically?
Only if ArgoCD auto-sync is enabled AND the changed YAML is committed to Git. Direct oc apply in production is bypassed by ArgoCD if selfHeal is enabled — ArgoCD will revert it. The correct workflow: commit YAML change to Git → merge PR → ArgoCD detects → syncs to cluster.
How to update image tag safely?
How to avoid updating multiple YAML files manually?
Use Helm or Kustomize — define the image tag once, override per environment:
Helm on OpenShift
What is Helm?
Helm is the package manager for Kubernetes/OpenShift. It packages K8s manifests into Charts — templated, versioned, deployable units. Like apt/yum but for Kubernetes applications.
What is a Helm Chart?
A directory structure containing: Chart.yaml (metadata), values.yaml (default configuration), templates/ (YAML templates with Go templating), and optionally sub-charts and hooks.
What is values.yaml?
Default configuration file for a Helm chart. Every parameter that varies between environments goes here. Override for specific environments with -f values-prod.yaml.
Structure of a Helm chart:
How Helm simplifies deployments:
How to upgrade application using Helm:
How Helm helps in central configuration:
One values.yaml controls all configuration. Need to change DB_HOST for all services? Change once in values.yaml, run helm upgrade. No hunting through 20 YAML files. Use Helmfile or ArgoCD ApplicationSet to manage multiple apps with Helm across multiple clusters.
Monitoring with Prometheus and Grafana
How Prometheus collects metrics?
Prometheus uses a pull model — it scrapes (HTTP GET) a /metrics endpoint on each target at a configured interval (default 30s). Targets are discovered via: ServiceMonitor CRDs, PodMonitor CRDs, static configs, or service discovery (OCP service discovery auto-discovers annotated services).
What is /metrics endpoint?
An HTTP endpoint that returns metrics in Prometheus text format:
Your application must expose this endpoint. Libraries: prometheus-client (Python), micrometer (Java/Spring), prom-client (Node.js).
What is ServiceMonitor?
A CRD (Custom Resource Definition) that tells Prometheus which Services to scrape and how:
What is PodMonitor?
Like ServiceMonitor but selects Pods directly instead of Services. Use when your pods don't have a Service, or when you want to scrape each pod individually (useful for sidecars or DaemonSets where each pod may have different metrics).
How to configure monitoring in OCP?
Difference between Prometheus and Grafana?
How to create an alert in OpenShift?
Via PrometheusRule CRD:
What is PrometheusRule?
A CRD that defines alerting rules and recording rules for Prometheus. Alerting rules define when to fire an alert (expr evaluates to true). Recording rules pre-compute expensive queries for faster dashboard rendering.
How AlertManager works?
AlertManager receives alerts from Prometheus, groups them (avoids alert storms), deduplicates, silences, inhibits, and routes to receivers (email, Slack, PagerDuty, webhook):
Flow of alerting system:
How to create CPU alert:
How to create Memory alert:
How to monitor certificate expiry:
Or use cert-manager operator which handles automatic certificate renewal and fires events when certs are near expiry.
How Prometheus checks application health (the up metric)?
When Prometheus scrapes a target, it sets the up metric:
up == 1 — scrape succeeded, target is healthyup == 0 — scrape failed (connection refused, timeout, HTTP error)Difference between Liveness, Readiness, and Prometheus alert?
| Liveness Probe | Readiness Probe | Prometheus Alert |
|---|
|---|---|---|---|
| **Run by** | Kubelet | Kubelet | Prometheus |
|---|---|---|---|
| Checks | Is container alive? | Ready for traffic? | Is metric threshold breached? |
| Action on failure | Restarts container | Removes from Service endpoints | Fires alert to Alertmanager |
| Response time | Seconds | Seconds | Minutes (evaluation interval + for duration) |
| Use for | Deadlock detection | Startup completion | Business and infrastructure alerting |
Secrets Management
How are secrets managed in OpenShift?
Default: OCP Secrets are base64-encoded and stored in etcd. Enable etcd encryption for true encryption at rest. For enterprise secret management, integrate with external systems:
How Azure Key Vault is integrated with OpenShift?
Using the Secrets Store CSI Driver + Azure Key Vault Provider:
SecretProviderClass pointing to Azure Key VaultWhat is Managed Identity?
An Azure identity assigned to a workload (pod) that allows it to authenticate to Azure services (Key Vault, Storage, etc.) without any credentials stored in the cluster. On AKS/ARO: Workload Identity (Pod Identity v2) assigns an Azure AD application to a Kubernetes Service Account. The pod gets an Azure token automatically — no keys or secrets needed.
How does an app get a secret from Key Vault?
Install Prometheus and Grafana on Kubernetes
How do you install Prometheus and Grafana on Kubernetes?
The easiest and most complete way is kube-prometheus-stack Helm chart:
On OpenShift specifically:
OCP 4.x ships with a complete monitoring stack in openshift-monitoring. Enable user workload monitoring instead of installing your own Prometheus:
This creates a separate Prometheus for your apps in openshift-user-workload-monitoring. Add ServiceMonitors to scrape your apps. Use the built-in Grafana or install community Grafana operator.

