This Markdown guide arranges the questions into interview-friendly patterns:
- Foundations: Kubernetes vs OpenShift
- Cluster Architecture and Installation
- Deployment and Application Lifecycle
- OpenShift Operations: MCO, Upgrades, Control Plane, etcd
- Troubleshooting Scenarios
- Security, SCC, Secrets, and Service Accounts
- Networking, DNS, Service Mesh, and Observability
- Backup, DR, Application Data, and Virtualization
- Large-Scale Platform Design
- Project Experience / Real Interview Story Format
- Quick Revision Sheet
Kubernetes is an open-source container orchestration platform used to deploy, scale, and manage containerized applications. OpenShift is Red Hat's enterprise Kubernetes platform built on Kubernetes, but it adds many production-ready features on top.
OpenShift includes Kubernetes plus additional components like integrated CI/CD options, image registry, Routes, Operators, OAuth integration, web console, Security Context Constraints, better enterprise support, cluster operators, and OpenShift-specific tools such as oc.
| Area | Kubernetes | OpenShift |
|---|---|---|
| Base platform | Upstream container orchestration | Enterprise Kubernetes platform |
| CLI | kubectl |
oc, also supports kubectl |
| Security | Pod Security Admission / RBAC | SCC, RBAC, OAuth, stricter defaults |
| Networking exposure | Ingress | Route + Ingress |
| Image registry | Optional | Integrated registry available |
| Console | Optional dashboard | Built-in web console |
| CI/CD | External tools | OpenShift Pipelines, GitOps, Builds |
| Support | Community/vendor dependent | Red Hat enterprise support |
| Operators | Optional | Operator-driven platform lifecycle |
| Node OS | Any supported Linux | Red Hat CoreOS for OCP nodes |
Kubernetes is the orchestration engine. OpenShift is an enterprise Kubernetes distribution with stronger security defaults, integrated developer experience, operators, routes, registry, monitoring, and lifecycle management.
Kubernetes has two major areas: the control plane and the data plane.
The control plane manages the cluster state. It includes the API server, etcd, scheduler, controller manager, and cloud controller manager. The data plane consists of worker nodes where actual application workloads run. It includes kubelet, kube-proxy or equivalent networking, container runtime, CNI, and Pods.
| Component | Role |
|---|---|
| API Server | Entry point for all cluster operations |
| etcd | Key-value store for cluster state |
| Scheduler | Assigns Pods to suitable nodes |
| Controller Manager | Runs controllers to reconcile desired state |
| Cloud Controller Manager | Integrates with cloud provider APIs |
| Component | Role |
|---|---|
| Worker Node | Runs application workloads |
| Kubelet | Node agent that manages Pods |
| Container Runtime | Runs containers, usually CRI-O/containerd |
| Kube-proxy / CNI | Handles service networking |
| Pods | Smallest deployable unit |
| Volumes | Provide storage to Pods |
OpenShift includes all Kubernetes core components plus OpenShift-specific operators and services.
| Component | Purpose |
|---|---|
| OpenShift API Server | Exposes OpenShift-specific APIs |
| Kubernetes API Server | Exposes Kubernetes APIs |
| etcd | Stores cluster state |
| Cluster Version Operator | Manages cluster upgrades |
| Machine Config Operator | Manages node OS configuration |
| Cluster Network Operator | Manages cluster networking |
| Ingress Operator | Manages routers and ingress |
| Authentication Operator | Manages OAuth and identity providers |
| Console Operator | Manages web console |
| Monitoring Operator | Provides Prometheus-based monitoring |
| Image Registry Operator | Manages internal image registry |
| Operator Lifecycle Manager | Manages operators |
| OpenShift SDN / OVN-Kubernetes | Cluster networking |
| Routes | OpenShift-native app exposure |
| SCC | Pod security enforcement |
OpenShift is Kubernetes plus enterprise operators, integrated registry, routes, OAuth, SCC, monitoring, console, and lifecycle automation.
Interview Answer:
They are almost the same, but the terminology is different.
A Namespace is the Kubernetes resource used to separate applications, users, and resources inside a cluster.
A Project is OpenShift’s user-friendly representation of a Kubernetes Namespace. When we create an OpenShift Project, OpenShift creates the corresponding Namespace and can also apply permissions, annotations, resource limits, and predefined project settings.
Therefore, the Namespace provides the technical isolation, while the Project provides an easier way for developers and teams to access and manage that isolated environment.
Best Interview Line:
A Namespace is the Kubernetes foundation, while a Project is OpenShift’s user-facing way of managing that Namespace.
Example:
When we run:
oc new-project development
OpenShift creates a Namespace named development, gives the user access to it, and switches the current working project to it.
| Area | Namespace | Project |
|---|---|---|
| Platform | Kubernetes concept | OpenShift concept |
| Purpose | Resource isolation | User-facing workspace |
| Created by | kubectl create namespace |
oc new-project |
| Extra metadata | Basic metadata | Display name, description, templates |
| Access model | RBAC | RBAC plus OpenShift project governance |
| User experience | Admin/dev manually uses namespace | Developer-friendly workspace |
kubectl create namespace dev
oc new-project dev
oc get projects
oc get namespacesOpenShift Cluster
├── Project: development → Namespace: development
├── Project: testing → Namespace: testing
└── Project: production → Namespace: production
Best Interview Line:
No, we cannot create multiple namespaces inside an OpenShift Project because a Project itself represents one Kubernetes Namespace. To create separate isolation boundaries, we create multiple Projects or Namespaces in the cluster.
SCC stands for Security Context Constraints. SCCs are OpenShift security controls that define what a Pod is allowed to do. They control whether a Pod can run as root, run privileged, use host networking, mount host paths, add Linux capabilities, or use specific SELinux contexts.
SCCs are similar in goal to Kubernetes Pod Security controls but are OpenShift-specific and more integrated with OpenShift security.
| Control | Example |
|---|---|
| Run as root | Allow or deny UID 0 |
| Privileged mode | Allow or deny privileged containers |
| Host network | Allow or deny hostNetwork |
| Host PID/IPC | Allow or deny host namespace access |
| HostPath volumes | Allow or deny mounting host paths |
| Linux capabilities | Allow/drop capabilities |
| SELinux | Enforce SELinux labels |
| Volume types | Control allowed volume plugins |
oc get scc
oc describe scc restricted-v2
oc adm policy who-can use scc/privileged
oc adm policy add-scc-to-user anyuid -z my-service-account -n my-namespaceSCC is one of the biggest differences between Kubernetes and OpenShift security. Many containers that run in vanilla Kubernetes fail in OpenShift because OpenShift is stricter by default.
2.1 You are given a task to create a Kubernetes cluster in AWS. What requirement gathering will you do?
Before creating a Kubernetes or OpenShift cluster in AWS, I gather requirements across business, application, network, security, operations, compliance, and cost.
| Area | Questions |
|---|---|
| Business | What is the purpose of the cluster? Dev, test, production, DR? |
| Availability | Required SLA, RTO, RPO? |
| Region | Which AWS region and availability zones? |
| Cluster type | EKS, self-managed Kubernetes, ROSA, or OpenShift IPI/UPI? |
| Workloads | Stateless, stateful, batch, AI/ML, microservices? |
| Scale | Number of applications, Pods, nodes, namespaces? |
| Compute | Instance types, GPU requirement, autoscaling? |
| Networking | VPC CIDR, Pod CIDR, Service CIDR, private/public subnets? |
| Ingress | ALB/NLB, OpenShift Routes, WAF, external DNS? |
| Security | IAM, RBAC, SSO, MFA, encryption, security scanning? |
| Storage | EBS, EFS, FSx, object storage, CSI driver? |
| Registry | ECR, Quay, internal registry, image scanning? |
| CI/CD | Jenkins, Argo CD, GitHub Actions, Tekton? |
| Observability | Prometheus, CloudWatch, Grafana, Loki, EFK? |
| Backup | etcd backup, Velero/OADP, database backup? |
| Compliance | PCI, HIPAA, ISO, SOC2, audit requirements? |
| Cost | Budget, tagging, autoscaling, reserved instances? |
| Operations | Patch process, upgrade process, support model? |
VPC design
Subnet design
NAT gateway requirement
Load balancer type
IAM roles
Security groups
Route tables
Private endpoint requirement
EBS encryption
KMS keys
CloudWatch integration
AWS Backup / Velero / OADP
I do not start with
eksctl create clusteror OpenShift installer immediately. I first collect workload, network, security, availability, storage, observability, compliance, and cost requirements.
In a real project, I installed OpenShift using the installer-provisioned infrastructure method on AWS. The high-level steps were requirement gathering, preparing DNS and cloud credentials, downloading the installer and pull secret, creating the install configuration, validating network and quota, running the installer, monitoring bootstrap, validating operators, and handing over the cluster to application teams.
Region
Availability zones
Cluster name
Base domain
Node count
Instance types
Network CIDRs
Storage class
Ingress requirement
Identity provider
Logging/monitoring
Backup requirement
AWS account
IAM permissions
Route53 hosted zone
SSH key
Red Hat pull secret
OpenShift installer
oc CLI
AWS CLI
mkdir ocp-install
cd ocp-installopenshift-install create install-config --dir=.Example values:
baseDomain: example.com
metadata:
name: prod-ocp
platform:
aws:
region: ap-south-1
controlPlane:
replicas: 3
compute:
- name: worker
replicas: 3openshift-install create cluster --dir=. --log-level=infoopenshift-install wait-for bootstrap-complete --dir=. --log-level=debugexport KUBECONFIG=auth/kubeconfig
oc get nodes
oc get co
oc get clusterversion
oc get pods -AIdentity provider
Default storage class
Image registry
Ingress certificates
Cluster monitoring
Logging
GitOps
RBAC groups
Network policies
Backup
Admin kubeconfig
Console URL
Authentication details
Monitoring dashboards
Backup procedure
Runbook
Access process
| Problem | Root Cause | Fix |
|---|---|---|
| Bootstrap failed | DNS record missing | Fixed Route53 records |
| Worker nodes not joining | Security group issue | Allowed required ports |
| Pull errors | Invalid pull secret | Updated pull secret |
| Operators degraded | Insufficient AWS quota | Increased quota |
| Ingress not reachable | Wrong public/private subnet tagging | Corrected subnet tags |
| Storage class issue | CSI driver/operator issue | Checked operator and AWS permissions |
I always validate DNS, IAM, quota, subnet routing, pull secret, and installer version before starting OpenShift installation because most installation failures happen around prerequisites.
First, I would clarify that I normally do not design one stretched OpenShift cluster across multiple distant regions. Stretching a single cluster across regions can create latency and etcd quorum problems.
My preferred approach is one OpenShift cluster per region, managed centrally using Red Hat Advanced Cluster Management and deployed consistently using GitOps tools such as Argo CD.
The design depends on the required RTO and RPO. For stateless applications, I prefer active-active across regions with global DNS or GSLB. For stateful applications, I design data replication at the database or storage layer, and I use OpenShift Data Foundation disaster recovery patterns where appropriate.
| Component | Design |
|---|---|
| Cluster model | One OpenShift cluster per region |
| Management | Red Hat Advanced Cluster Management hub |
| Deployment | Argo CD / GitOps |
| Traffic | Global DNS, GSLB, health checks, weighted routing |
| Apps | Active-active for stateless services |
| Data | Database replication or managed geo-database |
| Stateful DR | ODF Regional-DR / Metro-DR where suitable |
| Secrets | Central Vault or replicated secret manager |
| Registry | Quay or registry mirroring near each region |
| Observability | Central metrics, logs, traces with cluster labels |
| Failover | Automated or controlled based on RTO/RPO |
Global DNS / GSLB
|
-------------------------------------
| |
Region 1 OCP Cluster Region 2 OCP Cluster
| |
Apps + Local Services Apps + Local Services
| |
-------- Replicated Data Layer -------
|
Central Observability
Central GitOps / ACM
| Question | Design Consideration |
|---|---|
| Active-active or active-passive? | Depends on application design and data consistency |
| What is the RTO? | Determines failover automation |
| What is the RPO? | Determines replication strategy |
| Is the app stateless? | Easier to run active-active |
| Is the database regional? | Need database-level replication |
| How are secrets managed? | Central or replicated secret backend |
| How are images distributed? | Registry mirror per region |
| How is traffic routed? | GSLB with health checks |
I avoid stretching etcd across regions. I design one OpenShift cluster per region, manage them through ACM and GitOps, use global traffic management, and handle state through database replication or OpenShift Data Foundation disaster recovery depending on RTO and RPO.
When I run kubectl apply -f deployment.yaml, the manifest is sent to the Kubernetes API server. The API server authenticates the user, checks authorization through RBAC, runs admission controllers, validates the object, and stores the desired state in etcd.
The Deployment controller then notices the Deployment and creates or updates a ReplicaSet. The ReplicaSet controller ensures the required number of Pods exist. The scheduler assigns pending Pods to nodes, and kubelet starts the containers using the container runtime.
In OpenShift, additional checks like SCC, image policies, routes, and cluster operators can also be involved.
| Step | Component | Action |
|---|---|---|
| 1 | kubectl/oc | Sends manifest |
| 2 | API Server | AuthN/AuthZ/admission |
| 3 | etcd | Stores desired state |
| 4 | Deployment Controller | Creates ReplicaSet |
| 5 | ReplicaSet Controller | Creates Pods |
| 6 | Scheduler | Assigns Pods to nodes |
| 7 | Kubelet | Starts containers |
| 8 | Service/EndpointSlice | Updates backends |
kubectl applyupdates desired state. Controllers and kubelets do the actual work to make the cluster match that desired state.
Zero-downtime OpenShift upgrades require planning. I do not treat cluster upgrade as just clicking an upgrade button. I check cluster health, operator health, application redundancy, PodDisruptionBudgets, node capacity, backups, deprecated APIs, and maintenance windows.
OpenShift upgrades are managed by the Cluster Version Operator. The upgrade updates cluster operators and then node components through the Machine Config Operator. Worker nodes are usually drained and rebooted in a controlled manner.
| Phase | Checks |
|---|---|
| Pre-check | oc get co, oc get nodes, oc adm upgrade |
| Backup | Take etcd backup |
| App readiness | Replicas > 1, PDB configured |
| Capacity | Enough spare capacity during node drain |
| APIs | Check deprecated/removed APIs |
| Operators | Ensure all operators are compatible |
| Maintenance | Notify teams and define rollback/restore plan |
| Upgrade | Upgrade through web console or CLI |
| Monitor | Watch operators, nodes, MCPs |
| Post-check | Validate apps, routes, monitoring, logs |
oc get clusterversion
oc adm upgrade
oc get co
oc get mcp
oc get nodes
oc adm must-gatherAt least 2 replicas
Readiness probe configured
PodDisruptionBudget configured
RollingUpdate strategy
Enough cluster capacity
Stateless or properly replicated state
External dependency health
Cluster upgrades are only zero-downtime if applications are designed for disruption. OpenShift can upgrade safely, but workloads need replicas, readiness probes, PDBs, and spare capacity.
3.3 A deployment succeeds in staging but fails in production. What are the most likely causes and how do you systematically identify them?
If the same deployment succeeds in staging but fails in production, I compare differences between the environments. The issue is usually configuration, resource limits, security policies, image access, networking, secrets, storage, or version drift.
| Area | Possible Cause |
|---|---|
| Config | Different ConfigMap or environment variable |
| Secrets | Missing or wrong secret in production |
| RBAC | ServiceAccount lacks permission |
| SCC/PSS | Production has stricter security |
| Resources | Lower limits or no capacity in production |
| Image | ImagePullBackOff due to registry access |
| Network | NetworkPolicy blocks dependency |
| Storage | PVC/storage class missing |
| DNS | Different service name or namespace |
| Database | Production DB credentials or schema mismatch |
| Version | Different Kubernetes/OCP version |
| Admission | Production has stricter admission policy |
oc rollout status deployment/app -n prod
oc describe deployment app -n prod
oc get pods -n prod
oc describe pod pod-name -n prod
oc logs pod-name -n prod --previous
oc get events -n prod --sort-by=.lastTimestamp
oc get configmap,secret -n prod
oc get rolebinding,serviceaccount -n prod
oc get networkpolicy -n prod
oc get pvc -n prodoc get deployment app -n staging -o yaml > staging.yaml
oc get deployment app -n prod -o yaml > prod.yaml
diff staging.yaml prod.yamlI do not assume the code is wrong first. I compare staging and production across config, secrets, RBAC, SCC, resources, networking, storage, image access, and cluster policy.
3.4 A deployment went out and now health checks are passing but users report 500 errors. How do you investigate?
If health checks pass but users see 500 errors, it means the basic /health endpoint is not covering real user paths or dependencies. I check application logs, ingress/router logs, traces, metrics, dependency health, and recent deployment changes.
All users or some users?
One route or multiple routes?
One region or all regions?
One API endpoint or all endpoints?
Started after latest deployment?
oc rollout history deployment/app -n prod
oc rollout status deployment/app -n prod
oc get pods -n prod -o wide
oc describe pod pod-name -n prodoc logs -n prod deploy/app --since=30m
oc logs -n prod pod-name --previousLook for:
NullPointerException
DB connection error
timeout
authentication failure
external API failure
schema mismatch
bad config
5xx rate
p95/p99 latency
CPU/memory
DB connection pool
queue lag
dependency latency
Use trace ID/request ID to identify the exact failing downstream call.
The health check may only verify that the process is alive. A better readiness probe should verify critical dependencies or use separate deep health checks.
| Finding | Action |
|---|---|
| Bad deployment | Roll back |
| Missing config | Fix ConfigMap/Secret and restart |
| DB issue | Fix DB connectivity or schema |
| Dependency failure | Add timeout/fallback/circuit breaker |
| Bad readiness check | Improve readiness probe |
| Partial traffic failure | Check route, service, endpoints |
Passing health checks do not prove the application is working for real users. I validate real transaction paths, dependencies, logs, metrics, and traces.
3.5 A container is crashing immediately after startup in production but works fine locally. How will you fix?
I treat this as a difference between local and production runtime. I check logs, events, command/entrypoint, environment variables, secrets, file permissions, SCC restrictions, resource limits, image architecture, and dependency availability.
oc get pods -n prod
oc describe pod pod-name -n prod
oc logs pod-name -n prod
oc logs pod-name -n prod --previous
oc get events -n prod --sort-by=.lastTimestamp| Cause | Why It Works Locally But Fails in OCP |
|---|---|
| Runs as root locally | OpenShift runs with random non-root UID |
| Missing env variable | Local .env file exists, prod secret missing |
| File permission issue | App cannot write to directory |
| Wrong command | Entrypoint different in Kubernetes |
| Secret missing | Production secret not mounted |
| ConfigMap missing | App cannot read config |
| Port mismatch | App listens on wrong port |
| Dependency unavailable | DB/API/DNS blocked in prod |
| Resource limit | App killed or throttled |
| Image architecture | Wrong architecture image |
Do not require root user
Use writable directories like /tmp
Set proper file permissions
Use fsGroup if needed
Avoid writing to read-only image directories
Use correct SCC only when justified
RUN chmod -R g=u /app
USER 1001If it works locally but crashes in OpenShift, my first suspicion is runtime difference: non-root UID, missing config/secrets, file permissions, resource limits, or network dependency.
A Dockerfile without a normal base image uses FROM scratch. scratch is an empty image. It is useful for statically compiled binaries, especially Go applications.
You cannot use package managers, shells, or OS libraries inside scratch unless you copy them in. That means commands like sh, bash, apt, or yum will not work.
# Build stage
FROM golang:1.22 AS builder
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o app main.go
# Final minimal image
FROM scratch
COPY --from=builder /src/app /app
ENTRYPOINT ["/app"]| Item | Explanation |
|---|---|
FROM scratch |
Empty image |
| No shell | Cannot run /bin/sh |
| No package manager | Cannot install packages |
| Static binary needed | Best for Go/Rust/static C |
| Certificates | Need to copy CA certs if app calls HTTPS |
| User | Need to handle UID/security carefully |
FROM golang:1.22 AS builder
WORKDIR /src
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o app main.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /src/app /app
USER 1001
ENTRYPOINT ["/app"]A Dockerfile cannot truly run without any filesystem at all, but it can use
FROM scratch, which starts from an empty image. It is best for statically compiled binaries.
The Machine Config Operator manages the operating system configuration of OpenShift nodes. It applies MachineConfig objects to groups of nodes through MachineConfigPools. It can update files, systemd units, kernel arguments, registries, SSH keys, and other node-level settings.
The MCO renders MachineConfigs into a rendered configuration for each MachineConfigPool. The Machine Config Daemon runs on each node, compares the current node state with the desired rendered config, drains the node if required, applies the change, reboots the node when needed, and brings it back.
| Component | Role |
|---|---|
| MachineConfig | Desired node OS configuration |
| MachineConfigPool | Group of nodes receiving config |
| MachineConfigController | Creates rendered configs |
| MachineConfigDaemon | Applies config on each node |
| MachineConfigServer | Serves ignition configs |
| MachineConfigOperator | Overall lifecycle management |
oc get mcp
oc describe mcp worker
oc get machineconfig
oc describe machineconfig rendered-worker-xxxxx
oc get pods -n openshift-machine-config-operator
oc logs -n openshift-machine-config-operator ds/machine-config-daemon1. Admin creates or updates MachineConfig.
2. MCO renders a new configuration.
3. MCP detects new desired config.
4. MCD on each node starts update.
5. Node is cordoned/drained if needed.
6. Config is applied.
7. Node reboots if required.
8. Node returns to Ready.
9. MCP becomes Updated.
MCO is responsible for keeping node OS configuration declarative and consistent. It works through MachineConfigs, MachineConfigPools, rendered configs, and the Machine Config Daemon.
The recovery approach depends on whether the cluster still has etcd quorum.
If only one control plane node fails in a three-master cluster, the cluster usually still has quorum. I would replace the failed master node, ensure it joins the cluster, and verify etcd membership and cluster operators.
If the majority of control plane nodes are lost, then it becomes a disaster recovery scenario and I may need to restore etcd from a valid backup.
oc get nodes
oc get co
oc get pods -n openshift-etcd
oc get machine -n openshift-machine-apiFor IPI clusters:
Delete failed Machine object
Machine API recreates node
Verify node joins
Verify etcd member health
Verify cluster operators
Example:
oc delete machine failed-master -n openshift-machine-api
oc get machines -n openshift-machine-api
oc get nodesoc get co
oc get nodes
oc get pods -n openshift-etcdThis is quorum loss. Restore from etcd backup using the OpenShift documented recovery procedure.
First I check whether etcd quorum is still available. If quorum exists, I replace the failed control plane node. If quorum is lost, I move to etcd disaster recovery from a valid backup.
In OpenShift, etcd backup is usually taken from one healthy control plane node using the cluster-backup.sh script. I do not take backups from all masters. I take backup from one control plane node and store it securely outside the cluster.
ssh core@master-0sudo -imkdir -p /home/core/backup
/usr/local/bin/cluster-backup.sh /home/core/backupls -lh /home/core/backupExpected output usually includes:
snapshot_*.db
static_kuberesources_*.tar.gz
scp core@master-0:/home/core/backup/* .| Practice | Reason |
|---|---|
| Backup after upgrades | Restore must match cluster version |
| Store outside cluster | Cluster failure should not lose backup |
| Encrypt backup | Backup contains sensitive cluster state |
| Test restore | Untested backup is not reliable |
| Automate backup | Regular DR readiness |
| Keep version metadata | Match backup with OCP version |
In OpenShift, etcd backup is taken from a single control plane node using
cluster-backup.sh, and the backup must be stored securely outside the cluster.
etcd restore is a disaster recovery operation. I use it only when the cluster has lost majority control plane members or when I need to restore the cluster to a previous state.
The restore must use a backup from the same OpenShift z-stream version. I follow the official OpenShift restore procedure carefully.
1. Identify recovery control plane host.
2. Copy etcd snapshot and static pod resources to recovery host.
3. Stop static pods as required by procedure.
4. Run cluster-restore.sh with backup path.
5. Wait for etcd and API server to come back.
6. Verify cluster operators.
7. Remove/recreate failed control plane nodes if needed.
8. Validate workloads.
etcd restore is not a normal rollback tool.
It restores cluster state to a previous point in time.
Any resources created after the backup can be lost.
oc get nodes
oc get co
oc get clusterversion
oc get pods -A
oc get pods -n openshift-etcdetcd restore is a last-resort DR process. I first check quorum. If quorum is lost, I restore from a version-compatible etcd backup and then validate control plane, operators, and workloads.
If the Kubernetes/OpenShift API is down, I treat it as a control-plane incident. I first confirm whether the issue is API server, load balancer, DNS, authentication, network, or etcd.
oc whoami
oc get nodes
curl -k https://api.cluster.example.com:6443/readyznslookup api.cluster.example.com
curl -k https://api.cluster.example.com:6443/healthzCheck:
DNS record
Load balancer health
Security groups/firewall
API VIP
Network path
If API is unreachable externally, SSH to a master node.
ssh core@master-0
sudo crictl ps
sudo crictl logs <kube-apiserver-container-id>sudo crictl ps | grep kube-apiserver
sudo crictl ps | grep etcd
sudo crictl ps | grep kube-controller
sudo crictl ps | grep kube-schedulersudo crictl ps | grep etcd
sudo crictl logs <etcd-container-id>df -h
free -m
top
journalctl -u kubelet -n 100| Cause | Symptom |
|---|---|
| API LB down | API unavailable externally |
| DNS issue | API hostname not resolving |
| etcd down | API server cannot read state |
| Disk full | API/etcd static pods fail |
| Certificate issue | TLS/auth errors |
| Node failure | One or more masters unreachable |
| Network issue | Masters cannot communicate |
| Kubelet issue | Static pods not running |
| Finding | Action |
|---|---|
| LB/DNS issue | Fix DNS/LB/security groups |
| One master down | Replace/recover node |
| etcd quorum lost | Start DR process |
| Disk full | Free disk carefully |
| Certificate issue | Check cert rotation and operator status |
| Kubelet down | Restart/fix kubelet on master |
For API downtime, I check from outside-in: DNS, load balancer, API health, then from inside the control plane: kube-apiserver static pod, etcd health, kubelet, disk, certificates, and node status.
etcd disk usage at 95% is a critical control-plane incident. I do not randomly delete etcd files. I first identify what disk is full, check etcd alarms/logs, take a backup if possible, and follow documented defrag/cleanup procedures.
df -h
sudo du -sh /var/lib/etcd/*
sudo crictl ps | grep etcd
sudo crictl logs <etcd-container-id>From cluster if API is available:
oc get co
oc get pods -n openshift-etcd
oc get events -n openshift-etcd| Check | Reason |
|---|---|
| Disk partition | Confirm actual full filesystem |
| etcd DB size | Check if etcd database is large |
| Logs | Check compaction/defrag errors |
| Events | Identify control-plane issues |
| Backup | Ensure DR safety |
| Large objects | Check excessive secrets/configmaps/events |
| Audit/log files | Ensure not confusing etcd with log growth |
Too many Kubernetes events
Too many secrets/configmaps
High churn controllers
Large CRDs/custom resources
Misbehaving operators
No compaction/defrag issue
Disk too small
Logs filling same partition
1. Take etcd backup if possible.
2. Check etcd health and alarms.
3. Identify large resource growth.
4. Remove unnecessary high-churn resources.
5. Follow OpenShift-supported etcd defrag procedure if required.
6. Expand disk if supported/needed.
7. Monitor etcd DB size and disk alerts.
Do not manually delete files from /var/lib/etcd.
Do not reboot all masters together.
Do not restore without understanding current quorum.
Do not run random etcdctl operations without backup.
At 95% etcd disk usage, I treat it as a control-plane emergency. I take backup, preserve quorum, identify growth, follow supported defrag/cleanup procedures, and never manually delete etcd files.
5.1 You are migrating an application from Kubernetes to OpenShift and your container is not running. How will you troubleshoot it?
When an application runs in Kubernetes but fails in OpenShift, I first check OpenShift security differences. OpenShift is stricter by default, especially around running as root, file permissions, host access, and SCC.
oc get pods -n app-ns
oc describe pod pod-name -n app-ns
oc logs pod-name -n app-ns
oc logs pod-name -n app-ns --previous
oc get events -n app-ns --sort-by=.lastTimestamp
oc get scc
oc adm policy who-can use scc/anyuid| Issue | Cause | Fix |
|---|---|---|
| Permission denied | Random non-root UID | Fix image permissions |
| Container needs root | OpenShift restricted SCC blocks root | Refactor image or use controlled SCC |
| Cannot bind port 80 | Non-root cannot bind privileged port | Use port 8080 |
Writes to /app fail |
Directory not writable | Use /tmp or group-writable dir |
| HostPath blocked | SCC does not allow hostPath | Use PVC |
| Privileged container blocked | Restricted SCC | Avoid privileged or justify SCC |
| Image pull fail | Registry secret missing | Add imagePullSecret |
| Route not working | Service/Route mismatch | Check service targetPort |
Instead of giving anyuid or privileged immediately, I fix the container image to run as non-root and use proper permissions.
In Kubernetes-to-OpenShift migration, the first thing I check is SCC and non-root compatibility. OpenShift usually exposes hidden container security issues.
5.2 Your Kubernetes Pods are being OOMKilled repeatedly despite the application appearing to run fine locally. The memory limit is set to 512Mi but the process only uses 200MB. How do you fix this?
OOMKilled means the container exceeded its memory cgroup limit, even if the main process appears to use less memory. The difference can come from JVM heap, native memory, sidecars, page cache, memory spikes, tmpfs, threads, or multiple processes inside the container.
kubectl describe pod pod-name -n app-ns
kubectl logs pod-name -n app-ns --previous
kubectl top pod pod-name -n app-ns
kubectl get pod pod-name -n app-ns -o yamlCheck:
Exit code 137
Reason: OOMKilled
Memory limit
Memory requests
Sidecars
Application runtime settings
Peak memory, not average memory
| Reason | Explanation |
|---|---|
| Peak memory spike | Average is 200MB but peak exceeds 512Mi |
| JVM native memory | Heap is not total process memory |
| Page cache | Container memory includes cache |
| tmpfs | EmptyDir memory counts toward limit |
| Sidecar | Pod has another container using memory |
| Multiple processes | Main process is not the only memory user |
| Thread stacks | Many threads consume memory |
| Memory leak | Gradual growth before kill |
| Fix | Example |
|---|---|
| Increase limit | 512Mi to 1Gi after measurement |
| Set request properly | Request based on normal usage |
| Tune JVM | -XX:MaxRAMPercentage=70 |
| Check sidecar | Measure per-container usage |
| Reduce tmpfs usage | Avoid memory-backed emptyDir |
| Add monitoring | Alert before OOM |
| Load test | Reproduce production traffic |
| Profile memory | Heap dump/native memory tracking |
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"I trust cgroup memory more than local process observation. OOMKilled is based on container memory usage including spikes, cache, sidecars, native memory, and runtime overhead.
5.3 A microservice can reach the internet but cannot resolve internal DNS for other services. What do you check?
If internet works but internal DNS fails, I troubleshoot DNS path inside the cluster.
oc exec -n app-ns pod-name -- nslookup service-name
oc exec -n app-ns pod-name -- nslookup service-name.target-ns.svc.cluster.local
oc exec -n app-ns pod-name -- cat /etc/resolv.confoc get pod pod-name -n app-ns -o yaml | grep dnsPolicy -A5Expected:
dnsPolicy: ClusterFirstoc get pods -n openshift-dns
oc get svc -n openshift-dns
oc logs -n openshift-dns -l dns.operator.openshift.io/daemonset-dns=default
oc get co dnsoc get svc -n target-ns
oc get endpoints -n target-ns
oc get endpointslice -n target-nsoc get networkpolicy -ADNS traffic to CoreDNS/OpenShift DNS should be allowed on UDP/TCP 53.
Since internet works but internal DNS fails, I check FQDN, Pod DNS policy, OpenShift DNS/CoreDNS health, NetworkPolicy for port 53, and whether the target Service has endpoints.
5.4 A container is crashing immediately after startup in production but works fine locally. How will you fix?
See section 3.5.
See section 4.5.
5.6 A deployment went out and health checks are passing but users are getting 500 errors. How do you investigate?
See section 3.4.
5.7 You are seeing a latency spike in production. Walk me through how you would use logs, metrics, and traces together to find root cause in under 15 minutes.
I follow a correlation approach: metrics tell me where the problem is, traces tell me which dependency is slow, and logs prove the exact error.
Check p95/p99 latency
Check 5xx rate
Check affected route/service/namespace
Check if issue is one region or all regions
Check latest deployment/change
Check RED metrics:
| Metric | Meaning |
|---|---|
| Rate | Traffic volume |
| Errors | 4xx/5xx |
| Duration | Latency p95/p99 |
Also check:
CPU throttling
Memory pressure
Pod restarts
HPA events
Ingress/router latency
DB connection pool
Queue lag
DNS latency
Sidecar metrics
Open slow traces and identify the longest span:
Application handler
Database
External API
Auth service
DNS lookup
Downstream microservice
Message queue
Filter logs using trace ID/request ID:
oc logs -n prod deploy/app --since=15m
oc logs -n prod pod-name --since=15mLook for:
Timeouts
Connection refused
DB slow query
TLS error
DNS failure
OOMKilled
Rate limiting
Retry storm
| Root Cause | Action |
|---|---|
| Bad deployment | Roll back |
| CPU/memory saturation | Scale/tune resources |
| DB slow | Check locks/queries/pool |
| Dependency slow | Timeout/fallback/circuit breaker |
| One bad node | Cordon/drain |
| DNS issue | Check DNS operator/network policy |
| Retry storm | Reduce retries and add backoff |
I do not search logs randomly. I use metrics to find the service, traces to find the slow dependency, and logs with trace ID to confirm the root cause.
At scale, I do not store raw secrets directly in Git or create them manually in every namespace. I use an external secret manager such as HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager, or an enterprise KMS-backed solution.
Then I sync or mount secrets using External Secrets Operator, Secrets Store CSI Driver, Sealed Secrets, or SOPS depending on the GitOps model.
| Area | Practice |
|---|---|
| Source of truth | External secret manager |
| GitOps | Store encrypted secrets or ExternalSecret CRs |
| Access | Namespace-level least privilege |
| Rotation | Automated rotation |
| Encryption | etcd encryption at rest |
| Audit | Track reads/writes |
| Workload identity | Prefer short-lived identity |
| OpenShift | Use ESO, SCC, RBAC, namespace isolation |
Kubernetes Secrets are not an enterprise secret-management solution by themselves. At scale, I externalize secrets, automate rotation, control access, and audit usage.
I secure Kubernetes/OpenShift in layers: authentication, authorization, workload security, network security, secrets, image security, node hardening, audit, runtime detection, and backup.
| Layer | Controls |
|---|---|
| Authentication | SSO, OAuth, MFA |
| Authorization | RBAC least privilege |
| Pod security | SCC/PSS, non-root workloads |
| Network | Default-deny NetworkPolicy |
| Secrets | External manager, encryption, rotation |
| Images | Scanning, signing, trusted registry |
| Nodes | Patch, harden, restrict SSH |
| API | Audit logs, admission control |
| Runtime | Detect exec, privilege escalation |
| Backup | etcd/application backups |
My model is default-deny, least privilege, non-root workloads, network segmentation, secure supply chain, external secrets, and continuous audit.
6.3 An attacker gains access using a stolen service account token. What can they do, and how do you limit the blast radius?
A stolen service account token gives the attacker the permissions of that ServiceAccount. The impact depends on RBAC, SCC, NetworkPolicy, and secret access.
| Permission | Attacker Can |
|---|---|
get/list secrets |
Steal secrets |
create pods |
Run malicious workloads |
exec pods |
Access running containers |
patch deployments |
Inject malicious images |
create rolebindings |
Escalate privileges |
list services |
Map internal network |
create jobs |
Establish persistence |
use privileged SCC |
Attempt node compromise |
| Control | Action |
|---|---|
| RBAC | Least privilege |
| Namespace scope | Avoid cluster-wide permissions |
| Token | Short-lived projected tokens |
| Automount | Disable where not needed |
| SCC/PSS | Block privileged pods |
| NetworkPolicy | Restrict lateral movement |
| Secrets | Avoid list/watch secrets |
| Audit | Alert suspicious service account calls |
| Rotation | Rotate affected credentials |
oc auth can-i --as=system:serviceaccount:app-ns:app-sa --list -n app-ns
oc adm policy who-can get secrets -n app-ns
oc adm policy who-can create pods -n app-ns
oc adm policy who-can use scc/privileged
oc get rolebinding,clusterrolebinding -A | grep app-saA stolen service account token is only as dangerous as the permissions attached to it. I limit blast radius with least privilege, short-lived tokens, SCC, NetworkPolicy, and audit.
See section 1.6 and 5.1.
I have worked with service mesh concepts such as Istio and OpenShift Service Mesh for service-to-service traffic management, mTLS, canary deployments, retries, timeouts, circuit breakers, authorization, and observability.
I use service mesh when a platform needs consistent east-west traffic security and visibility without requiring every team to build these capabilities into application code.
| Use Case | Service Mesh Capability |
|---|---|
| Encryption | mTLS |
| Identity | Workload identity |
| Canary | Weighted routing |
| Resilience | Retries/timeouts/circuit breaker |
| Observability | Metrics/traces/service graph |
| Authorization | Service-to-service access policy |
| Egress | Controlled outbound traffic |
I use service mesh when platform-level traffic control, security, and observability are needed consistently across microservices.
7.2 What is a service mesh and what problems does it solve that a traditional load balancer does not?
A traditional load balancer distributes traffic, mainly north-south traffic entering the application. A service mesh controls east-west traffic between microservices inside the cluster.
| Capability | Load Balancer | Service Mesh |
|---|---|---|
| Basic traffic distribution | Yes | Yes |
| East-west control | Limited | Strong |
| mTLS between services | No/limited | Yes |
| Service identity | Limited | Yes |
| Fine-grained authorization | Limited | Yes |
| Canary splitting | Limited | Yes |
| Retries/timeouts | Basic | Advanced |
| Circuit breaking | Limited | Yes |
| Distributed tracing | No | Yes |
| Service graph | No | Yes |
A load balancer distributes traffic. A service mesh secures, observes, and controls service-to-service communication.
I would not use one central Prometheus to scrape all Pods in all clusters. I would run Prometheus locally in each cluster and aggregate metrics centrally using Thanos, Cortex, Mimir, Prometheus remote write, federation, or Red Hat ACM Observability.
Cluster A Prometheus ----\
Cluster B Prometheus -----\
Cluster C Prometheus ------> Central Query / Long-Term Storage
Cluster D Prometheus -----/
| Area | Approach |
|---|---|
| Scraping | Local per cluster |
| HA | Prometheus HA pairs |
| Scale | Sharding |
| Labels | cluster, region, env, tenant |
| Storage | Object storage |
| Query | Thanos/Cortex/Mimir |
| Alerting | Local critical + global SLO alerts |
| Cardinality | Strict metric label governance |
Keep scraping local, aggregate global. Use per-cluster Prometheus, HA, sharding, remote write/Thanos, and strict cardinality control.
Yes. OpenShift supports virtual machines using OpenShift Virtualization, which is based on KubeVirt. It allows teams to run and manage VMs alongside containers on the same OpenShift platform.
| Use Case | Example |
|---|---|
| Legacy apps | Apps not yet containerized |
| Migration | Move VMs to OpenShift |
| Hybrid workload | Containers + VMs |
| Modernization | Gradual VM-to-container journey |
| Dev/Test | Temporary VM environments |
oc get csv -n openshift-cnv
oc get kubevirt -n openshift-cnv
oc get vm -A
oc get vmi -AYes, with OpenShift Virtualization we can run VMs on OpenShift, which helps support legacy workloads and migration paths while using Kubernetes-style management.
Application backup depends on what needs to be protected. I separate cluster state backup from application data backup.
etcd backup protects cluster state, not necessarily application-level data. Application backup should include Kubernetes manifests, persistent volume data, database backups, secrets/configs, and external dependencies.
| Data Type | Backup Method |
|---|---|
| Kubernetes manifests | GitOps repository |
| Persistent volumes | OADP/Velero with CSI snapshots |
| Databases | Database-native backup |
| Secrets | External secret manager backup |
| Images | Registry backup or mirror |
| Cluster state | etcd backup |
| VM workloads | OADP with OpenShift Virtualization plugin |
1. Install OADP Operator.
2. Configure backup storage location.
3. Configure snapshot location.
4. Create Backup CR.
5. Verify backup status.
6. Test restore in non-prod.
apiVersion: velero.io/v1
kind: Backup
metadata:
name: app-backup
namespace: openshift-adp
spec:
includedNamespaces:
- app-ns
storageLocation: defaultetcd backup is for cluster state. Application backup requires GitOps manifests, PVC snapshots, database-native backup, secrets backup, and tested restore procedures.
See sections 4.3 and 4.4.
For 500+ microservices, I focus on platform scalability, tenancy, security, observability, deployment standardization, and governance. I would not let every team deploy differently.
| Area | Design |
|---|---|
| Tenancy | Namespace/project per team or app domain |
| RBAC | Group-based least privilege |
| Network | Default-deny NetworkPolicies |
| CI/CD | Standard GitOps pipelines |
| Ingress | Route/Ingress standards |
| Service mesh | For critical east-west traffic |
| Observability | Standard logs, metrics, traces |
| Resource mgmt | Quotas, LimitRanges, HPA |
| Secrets | External secret manager |
| Policies | Admission control / OPA / Kyverno |
| Images | Trusted registry, scanning |
| Reliability | PDB, probes, SLOs |
| Cost | Chargeback/showback labels |
| Multi-cluster | Split by environment, region, business unit, or scale |
team-a-dev
team-a-test
team-a-prod
team-b-dev
team-b-test
team-b-prod
Readiness/liveness probes
Resource requests/limits
PDB
HPA
Security context
Non-root image
NetworkPolicy
Centralized logging
Metrics endpoint
Trace propagation
At 500+ microservices, the challenge is not only Kubernetes scale. The real challenge is governance, standardization, observability, security, deployment consistency, and team autonomy.
Configuration drift happens when the live cluster state differs from the desired state stored in Git. With Jenkins, I handle drift by making Git the source of truth and running scheduled drift detection jobs.
| Step | Action |
|---|---|
| 1 | Store manifests/Helm/Kustomize in Git |
| 2 | Jenkins pulls desired config |
| 3 | Jenkins compares desired vs live |
| 4 | Generate diff report |
| 5 | Fail pipeline or alert if drift exists |
| 6 | Optionally auto-correct with approval |
| 7 | Store audit trail |
kubectl diff -f manifests/
kubectl apply --server-side --dry-run=server -f manifests/
helm diff upgrade app chart/ -n app-ns
kustomize build overlays/prod | kubectl diff -f -pipeline {
agent any
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Detect Drift') {
steps {
sh '''
kustomize build overlays/prod > desired.yaml
kubectl diff -f desired.yaml || true
'''
}
}
stage('Apply With Approval') {
steps {
input message: 'Apply desired state to fix drift?'
sh 'kubectl apply -f desired.yaml'
}
}
}
}For Kubernetes drift management, GitOps tools like Argo CD or Flux are usually better than Jenkins because they continuously reconcile desired and live state.
Jenkins can detect and correct drift using
kubectl diff, Helm diff, and Git as source of truth, but for continuous drift reconciliation I prefer Argo CD or Flux.
10.1 Explain a project experience in deploying an OpenShift cluster and how you addressed deployment errors.
In one project, we had to deploy an OpenShift cluster on AWS for multiple application teams. The requirement was to support production-grade microservices with secure access, centralized monitoring, GitOps deployment, and high availability.
My responsibility was to help with cluster installation, validate prerequisites, configure post-install components, onboard applications, and troubleshoot deployment failures during migration.
I started with requirement gathering: region, availability zones, VPC/subnet design, DNS, IAM permissions, node sizing, storage class, ingress, certificates, identity provider, backup, and monitoring.
After preparing the prerequisites, I used the OpenShift installer to deploy the cluster. Once installation completed, I validated cluster operators, nodes, routes, monitoring, image registry, and storage.
During application onboarding, a few deployments failed. The most common issue was that the application containers were built assuming root access. They worked in vanilla Kubernetes but failed in OpenShift because OpenShift assigns a random non-root UID by default.
I investigated using:
oc describe pod
oc logs
oc get events
oc get scc
oc adm policy who-can use scc/anyuidThe error showed permission denied while writing to the application directory. Instead of immediately assigning privileged SCC, I worked with the application team to update the Dockerfile, fix file permissions, use a writable directory, and run the app as non-root.
Example fix:
RUN chmod -R g=u /app
USER 1001For a few vendor images that required root, we created a controlled service account and assigned a limited SCC only after security approval.
The applications were successfully onboarded without weakening the cluster-wide security posture. We also created a container image checklist for teams migrating to OpenShift.
The biggest lesson was that migration to OpenShift is not just deployment YAML migration. Container images must be OpenShift-ready, especially around non-root execution, file permissions, ports, and SCC compliance.
10.2 Explain how you installed an OCP cluster step by step, what difficulties you faced, and how you fixed them.
I installed OpenShift using IPI on AWS. The steps were:
1. Requirement gathering
2. AWS prerequisite validation
3. DNS and base domain setup
4. Pull secret and SSH key preparation
5. OpenShift installer download
6. install-config.yaml generation
7. Cluster installation
8. Bootstrap monitoring
9. Operator validation
10. Post-install configuration
11. Application onboarding
openshift-install create install-config --dir=ocp-install
openshift-install create cluster --dir=ocp-install --log-level=info
export KUBECONFIG=ocp-install/auth/kubeconfig
oc get nodes
oc get co
oc get clusterversion| Difficulty | Root Cause | Fix |
|---|---|---|
| Bootstrap failed | DNS issue | Corrected Route53 entries |
| Nodes not joining | Security group restrictions | Opened required ports |
| Cluster operators degraded | AWS quota issue | Increased service quota |
| Image pull error | Pull secret issue | Updated pull secret |
| Ingress unavailable | Subnet/LB tag issue | Fixed AWS subnet tags |
| App deployment failed | SCC/non-root issue | Fixed image permissions |
| PVC pending | Storage class/CSI issue | Validated storage operator |
I approach installation failures by validating prerequisites first: DNS, IAM, networking, quota, pull secret, bootstrap logs, cluster operators, and Machine API objects.
MCO manages OpenShift node OS configuration through MachineConfig and MachineConfigPool. The Machine Config Daemon applies rendered configs on nodes, drains/reboots nodes when required, and reports MCP status.
First check etcd quorum. If quorum exists, replace the failed master node. If quorum is lost, restore from a valid etcd backup. Validate nodes, etcd pods, and cluster operators.
SSH to one control plane node and run:
sudo -i
mkdir -p /home/core/backup
/usr/local/bin/cluster-backup.sh /home/core/backupCopy snapshot_*.db and static_kuberesources_*.tar.gz outside the cluster.
Use the OpenShift-supported restore procedure with a backup from the same z-stream version. Restore is used for quorum loss or disaster recovery, not as a normal rollback.
Check cluster health, take etcd backup, validate operators, ensure workloads have multiple replicas, readiness probes, PDBs, and spare capacity. Upgrade using Cluster Version Operator and monitor MCPs/operators.
Check DNS, load balancer, API health, kube-apiserver static pods, etcd health, master node resources, certificates, kubelet, disk, and network connectivity.
Treat as critical. Do not delete etcd files manually. Take backup if possible, check etcd health, identify growth, follow supported defrag/cleanup process, and expand disk if needed.
Use namespaces/projects per team/app, RBAC, NetworkPolicies, GitOps, quotas, standard deployment templates, service mesh where needed, central observability, image governance, and multi-cluster strategy.
Use Git as source of truth. Jenkins runs kubectl diff, helm diff, or Kustomize diff. Alert or apply changes after approval. For continuous reconciliation, prefer Argo CD or Flux.
Kubernetes is the open-source orchestration engine. OpenShift is enterprise Kubernetes with additional security, operators, routes, registry, console, OAuth, SCC, monitoring, and support.
- Difference between Kubernetes and OpenShift
- Kubernetes control plane and data plane components
- OpenShift main components
- Project vs Namespace
- SCC in OpenShift
- VM support in OpenShift
- Requirement gathering for Kubernetes cluster in AWS
- OpenShift installation steps
- Multi-region OpenShift design
- 500+ microservices design
- What happens during
kubectl apply - Staging succeeds but production fails
- Health checks pass but users get 500 errors
- Container crashes in production but works locally
- Dockerfile with
FROM scratch - Zero-downtime OpenShift upgrades
- API down in production
- etcd consuming 95% disk
- OOMKilled despite low process memory
- Internal DNS resolution failure
- Kubernetes to OpenShift migration failure
- Latency spike RCA using logs, metrics, traces
- Secret management at scale
- Kubernetes cluster security approach
- Stolen service account token attack
- SCC troubleshooting
- RBAC and least privilege
- Experience with service mesh
- Service mesh vs load balancer
- Prometheus scaling for multi-cluster
- Logs, metrics, traces correlation
- etcd backup
- etcd restore
- Application data backup
- VM backup in OpenShift
- Control plane node recovery
In OpenShift and Kubernetes operations, I focus on declarative infrastructure, reconciliation, security-by-default, least privilege, GitOps, observability, disaster recovery, automation, and production readiness. I troubleshoot systematically by checking desired state, actual state, events, logs, metrics, traces, policies, and recent changes. For OpenShift specifically, I pay close attention to SCC, operators, MachineConfigPools, cluster operators, etcd health, and upgrade readiness.
These official references are useful for deeper preparation:
- Kubernetes Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- Kubernetes DNS for Services and Pods: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/
- Kubernetes Service Accounts: https://kubernetes.io/docs/concepts/security/service-accounts/
- Kubernetes RBAC Good Practices: https://kubernetes.io/docs/concepts/security/rbac-good-practices/
- Dockerfile Reference: https://docs.docker.com/reference/dockerfile/
- OpenShift Machine Config Operator: https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/machine_configuration/machine-config-index
- OpenShift MachineConfig objects: https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/machine_configuration/machine-configs-configure
- OpenShift etcd backup and restore: https://docs.redhat.com/en/documentation/openshift_container_platform/4.12/html/backup_and_restore/control-plane-backup-and-restore
- OpenShift Backup and Restore Overview: https://docs.redhat.com/en/documentation/openshift_container_platform/4.17/html/backup_and_restore/backup-restore-overview
- OpenShift Security Context Constraints: https://docs.redhat.com/en/documentation/openshift_container_platform/4.14/html/authentication_and_authorization/managing-pod-security-policies
- OpenShift Application Backup with OADP: https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/backup_and_restore/oadp-application-backup-and-restore
- OpenShift Virtualization Backup and Restore: https://docs.redhat.com/en/documentation/openshift_container_platform/4.16/html/virtualization/backup-and-restore
- OpenShift Multi-site / etcd guidance: https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/etcd/guidance-for-clusters-that-span-data-centers
- OpenShift Data Foundation Regional DR: https://docs.redhat.com/en/documentation/red_hat_openshift_data_foundation/4.18/html/configuring_openshift_data_foundation_disaster_recovery_for_openshift_workloads/rdr-solution
- Istio Traffic Management: https://istio.io/latest/docs/concepts/traffic-management/
- Istio Observability: https://istio.io/latest/docs/concepts/observability/
- Prometheus Federation: https://prometheus.io/docs/prometheus/latest/federation/
- Prometheus Remote Write: https://prometheus.io/docs/specs/prw/remote_write_spec/
- Prometheus Operator High Availability: https://prometheus-operator.dev/docs/platform/high-availability/
- Thanos Design: https://thanos.io/tip/thanos/design.md/
Answer:
OpenShift networking allows Pods, Services, nodes, and external users to communicate with each other.
It mainly handles:
- Pod-to-Pod communication
- Pod-to-Service communication
- Communication between different Projects
- External access through Routes
- Network security through NetworkPolicies
- Access to external systems
OpenShift currently uses OVN-Kubernetes as its default network provider.
Example:
External User
|
OpenShift Route
|
Service
|
Application Pods
Answer:
Each Pod receives its own IP address.
Pod IP: 10.128.2.15
The Pod IP can change when the Pod is deleted or recreated.
A Service provides a stable virtual IP address for accessing a group of Pods.
Service IP: 172.30.50.20
A Node IP is the IP address of the worker or control-plane machine.
Node IP: 192.168.10.21
Interview line:
Pod IPs are temporary, Service IPs are stable virtual IPs, and Node IPs belong to the cluster machines.
Answer:
Every Pod receives an IP address from the cluster network. Pods can communicate directly by using Pod IP addresses.
However, applications should normally communicate through a Service instead of using Pod IPs directly.
Example:
Frontend Pod
|
| http://backend-service:8080
|
Backend Service
|
Backend Pods
Test the connection with:
oc exec -it frontend-pod -- curl http://backend-service:8080Answer:
Yes, normally Pods in different Projects can communicate unless a NetworkPolicy or administrative policy restricts the traffic.
By default, Pods can communicate freely, but when a NetworkPolicy selects a Pod, traffic that is not explicitly allowed can be denied.
Example:
An application in the frontend Project can access a Service in the backend Project by using:
backend-service.backend.svc.cluster.local
Test it with:
oc exec -it frontend-pod -n frontend -- \
curl http://backend-service.backend.svc.cluster.local:8080Answer:
A Service provides a stable IP address and DNS name for a group of Pods.
Pods can be created, deleted, or scaled, but the Service address remains stable.
The Service uses labels and selectors to identify its backend Pods.
Example Service:
apiVersion: v1
kind: Service
metadata:
name: web-service
spec:
selector:
app: web
ports:
- port: 80
targetPort: 8080This Service listens on port 80 and sends traffic to port 8080 on Pods labelled:
app: webAnswer:
Makes the application available only inside the cluster.
type: ClusterIPExposes the application on a port of every node.
type: NodePortRequests an external load balancer from the cloud or load-balancer provider.
type: LoadBalancerMaps the Service to an external DNS name.
type: ExternalName
externalName: database.example.comInterview line:
ClusterIP is for internal access, NodePort exposes a node port, and LoadBalancer provides external access using an external load balancer.
In OpenShift, applications are commonly exposed through Routes instead of directly using NodePort.
Answer:
A Route exposes an internal Service outside the OpenShift cluster using a hostname.
A Route does not normally connect directly to Pods. It sends traffic to a Service, and the Service sends traffic to Pods.
OpenShift Routes support features such as TLS termination, passthrough, re-encryption, and traffic splitting.
Example:
oc expose service web-serviceCheck the Route:
oc get routeExample output:
NAME HOST
web-service web-service-demo.apps.example.com
Traffic flow:
User
|
Route
|
Service
|
Pods
Answer:
Both Route and Ingress expose applications outside the cluster.
A Route is an OpenShift-specific resource. Ingress is a standard Kubernetes resource.
OpenShift Routes provide built-in features such as:
- Edge TLS termination
- Passthrough TLS
- Re-encrypt TLS
- Weighted traffic splitting
Interview line:
Ingress is a Kubernetes resource, while Route is OpenShift’s native method for exposing Services externally.
Answer:
The OpenShift router receives incoming traffic and forwards it to the correct Service based on the Route hostname and path.
The router is managed by the OpenShift Ingress Controller.
Example:
Request:
https://shop.apps.example.com
Router checks:
Host = shop.apps.example.com
Then forwards traffic to:
shop-service → shop Pods
Useful commands:
oc get ingresscontroller -n openshift-ingress-operatoroc get pods -n openshift-ingressAnswer:
The traffic usually follows this path:
User
|
External Load Balancer
|
OpenShift Router
|
Route
|
Service
|
Pod
Example:
A user opens:
https://myapp.apps.example.com
The router matches the hostname with the Route, forwards the request to the Service, and the Service selects one of the healthy application Pods.
Answer:
OpenShift provides internal DNS for Services.
Applications can use the Service name instead of remembering IP addresses.
http://database:5432
http://database.production:5432
database.production.svc.cluster.local
Example:
oc exec -it application-pod -- \
curl http://backend-service:8080Check DNS from a Pod:
oc exec -it application-pod -- \
nslookup backend-serviceAnswer:
A Service uses a label selector.
Pod label:
metadata:
labels:
app: paymentService selector:
spec:
selector:
app: paymentBecause the labels match, the Service sends traffic to that Pod.
Check the labels:
oc get pods --show-labelsCheck the Service selector:
oc describe service payment-serviceAnswer:
The Service will not have any backend endpoints.
The Service object may exist, but it cannot send traffic to any Pod.
Example:
Service selector:
selector:
app: frontendPod label:
labels:
app: webThe values frontend and web do not match.
Solution:
Change the Service selector or Pod label so they match.
Check endpoints:
oc get endpoints frontend-serviceAlso check EndpointSlices:
oc get endpointslice \
-l kubernetes.io/service-name=frontend-serviceAnswer:
A headless Service does not receive a ClusterIP.
It returns the IP addresses of individual Pods through DNS instead of load-balancing traffic through a virtual Service IP.
Example:
apiVersion: v1
kind: Service
metadata:
name: database
spec:
clusterIP: None
selector:
app: database
ports:
- port: 5432Headless Services are commonly used with StatefulSets and clustered applications.
TLS ends at the OpenShift router. Traffic between the router and application is normally HTTP.
Client --HTTPS--> Router --HTTP--> Pod
Encrypted traffic passes through the router. The application Pod handles the TLS certificate.
Client --HTTPS--> Router --HTTPS unchanged--> Pod
The router decrypts the request and creates another encrypted connection to the application.
Client --HTTPS--> Router --HTTPS--> Pod
These are the three main TLS termination options supported by OpenShift Routes.
Interview line:
Edge terminates TLS at the router, passthrough terminates it at the Pod, and re-encrypt creates two TLS connections.
Answer:
A NetworkPolicy controls which network traffic is allowed to enter or leave selected Pods.
It uses:
- Pod labels
- Namespace labels
- IP blocks
- Ports
- Ingress rules
- Egress rules
Once a NetworkPolicy selects a Pod for a particular traffic direction, traffic not allowed by applicable policies is rejected for that direction.
Answer:
Create a default-deny ingress NetworkPolicy.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-all-ingress
namespace: backend
spec:
podSelector: {}
policyTypes:
- IngressApply it:
oc apply -f deny-all-ingress.yamlThis selects all Pods in the backend Project and blocks incoming traffic unless another NetworkPolicy allows it.
Answer:
Use a NetworkPolicy with a namespace selector.
Requirement:
Only Pods from the frontend Project should access database Pods in the backend Project on port 5432.
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-frontend-to-database
namespace: backend
spec:
podSelector:
matchLabels:
app: database
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: frontend
ports:
- protocol: TCP
port: 5432Apply it:
oc apply -f allow-frontend-to-database.yamlInterview line:
I would first apply a default-deny policy and then add an allow policy using namespace and Pod selectors.
Answer:
OVN-Kubernetes is the default networking solution in current OpenShift releases.
It provides:
- Pod networking
- Service networking
- NetworkPolicy support
- EgressIP
- EgressFirewall
- Overlay networking
- Load-balancing functions
It uses Open Virtual Network and Open vSwitch to implement network connectivity and traffic rules.
Interview line:
OVN-Kubernetes is OpenShift’s default CNI network provider and manages Pod connectivity, network policies, Services, and egress traffic.
Answer:
An overlay network creates a virtual network on top of the physical node network.
It allows Pods running on different nodes to communicate as though they were connected to the same network.
Example:
Pod A: 10.128.1.10
Worker Node 1: 192.168.1.10
Pod B: 10.129.2.20
Worker Node 2: 192.168.1.11
The overlay network carries traffic between Pod A and Pod B through the physical node network.
Traffic inside the cluster.
Examples:
Pod → Pod
Pod → Service
Project → Project
Traffic entering or leaving the cluster.
Examples:
External User → Route → Pod
Pod → External Database
Interview line:
East-west traffic stays inside the cluster, while north-south traffic enters or leaves the cluster.
Answer:
EgressIP provides a fixed source IP address for traffic leaving selected Pods or Projects.
It is useful when an external database or firewall allows traffic only from approved IP addresses.
Example scenario:
A bank database allows connections only from:
192.168.50.25
Configure the application Pods to use this IP as their EgressIP.
Example object:
apiVersion: k8s.ovn.org/v1
kind: EgressIP
metadata:
name: finance-egress
spec:
egressIPs:
- 192.168.50.25
namespaceSelector:
matchLabels:
egress-group: financeLabel the Project:
oc label namespace finance egress-group=financeA node must also be configured to host EgressIP addresses.
Interview line:
EgressIP gives selected workloads a predictable source IP when they connect to external systems.
Answer:
An EgressFirewall controls which external destinations Pods in a Project can access.
It can allow or deny traffic based on:
- CIDR ranges
- DNS names
- Node selectors
Only one EgressFirewall object can exist in a Project. Rules are evaluated in order.
Example:
Allow access to a partner API and deny other external destinations:
apiVersion: k8s.ovn.org/v1
kind: EgressFirewall
metadata:
name: default
namespace: finance
spec:
egress:
- type: Allow
to:
dnsName: api.partner.example.com
- type: Deny
to:
cidrSelector: 0.0.0.0/0Care must be taken to allow DNS, OpenShift API, and other required services before adding a global deny rule.
Answer:
Multus allows a Pod to have more than one network interface.
The Pod normally has one interface connected to the default cluster network. Multus can attach additional interfaces connected to other networks.
OpenShift uses Multus to support secondary networks and additional CNI plugins.
Example:
Pod
├── eth0: Default cluster network
└── net1: Storage or telecom network
Pod annotation:
metadata:
annotations:
k8s.v1.cni.cncf.io/networks: storage-networkAnswer:
A NetworkAttachmentDefinition defines a secondary network that can be attached to Pods through Multus.
Example:
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
name: storage-network
namespace: application
spec:
config: |
{
"cniVersion": "0.3.1",
"type": "macvlan",
"master": "ens224",
"mode": "bridge",
"ipam": {
"type": "static"
}
}The Pod can then request this network using an annotation.
Answer:
A 503 from the OpenShift router commonly means the router found the Route but could not reach a healthy backend.
Check the components in this order:
oc get route
oc describe route my-routeVerify:
- Correct Service name
- Correct target port
- Route admitted by the router
oc get service my-service
oc describe service my-serviceVerify:
- Correct selector
- Correct
port - Correct
targetPort
oc get pods
oc get pods --show-labelsVerify:
- Pods are running
- Pods are Ready
- Labels match the Service selector
oc get endpoints my-serviceOr:
oc get endpointslice \
-l kubernetes.io/service-name=my-serviceIf no endpoint is shown, the Service is not selecting any ready Pods.
oc run curl-test \
--image=curlimages/curl \
--restart=Never \
-it --rm -- \
curl http://my-service:8080Common causes:
- Service selector does not match Pod labels
- Pod is not Ready
- Wrong Service target port
- Route points to the wrong Service
- Application is listening only on
127.0.0.1 - NetworkPolicy blocks router traffic
Answer:
Possible reasons include:
- Service selector does not match Pod labels.
- No Pods are running.
- Pods are not Ready.
- The Service has no selector.
- The Pods are running in a different Project.
- The application deployment uses different labels.
Commands:
oc get svc my-service -o yamloc get pods --show-labelsoc get endpoints my-serviceExample fix:
Service selector:
selector:
app: paymentPod must have:
labels:
app: paymentAnswer:
Because the Service works, the Pods and Service are probably healthy. Focus on the Route and router.
Check:
oc describe route my-routeVerify:
- Route points to the correct Service
- Route target port matches the Service port name
- TLS termination is configured correctly
- Hostname resolves to the ingress address
- Route has been admitted
- NetworkPolicy allows traffic from the ingress router
Check DNS:
nslookup myapp.apps.example.comCheck the external response:
curl -vk https://myapp.apps.example.comAnswer:
Check the following:
- Egress NetworkPolicy
- EgressFirewall
- DNS resolution
- Node gateway configuration
- Proxy settings
- External firewall rules
- NAT or OVN gateway configuration
Test DNS:
oc exec -it my-pod -- nslookup example.comTest connectivity by IP:
oc exec -it my-pod -- curl -I https://1.1.1.1Test by hostname:
oc exec -it my-pod -- curl -I https://example.comIf IP works but hostname fails, the likely problem is DNS.
Answer:
Check:
oc exec -it source-pod -n frontend -- \
nslookup backend-service.backend.svc.cluster.localoc get endpoints backend-service -n backendoc get networkpolicy -n frontend
oc get networkpolicy -n backendoc exec -it source-pod -n frontend -- \
curl http://backend-service.backend.svc.cluster.local:8080The application should normally listen on:
0.0.0.0
It should not listen only on:
127.0.0.1
OpenShift networking uses OVN-Kubernetes to provide Pod and Service connectivity. Services provide stable internal access, while Routes expose Services externally. DNS provides Service discovery, NetworkPolicies control Pod traffic, EgressIP provides a fixed outgoing IP, EgressFirewall controls external access, and Multus allows Pods to use multiple network interfaces. For troubleshooting, I check the traffic path layer by layer: Route, Service, endpoints, Pod readiness, ports, DNS, and NetworkPolicies.