OpenShift Interview Questions on Services, Routes and Storage
Core OpenShift interview questions become easier when you trace what each resource contributes to an application. A Pod runs containers, a Service identifies reachable backends, a Route provides a configured external entry point, and a persistent volume claim requests storage. These resources solve different problems and need separate validation.
Topic: OpenShift in IT Infrastructure · Interview preparation
Quick answer: Core OpenShift interview questions become easier when you trace what each resource contributes to an application. A Pod runs containers, a Service identifies reachable backends, a Route provides a configured external entry point, and a persistent volume claim requests storage. These resources solve different problems and need separate validation. The original practice case follows a fictional catalog service whose named target port is inconsistent. Answers use OpenShift Container Platform 4.22 product documentation and stable Kubernetes concepts, without claiming that a supplied configuration has been deployed.
Key takeaways
- Explain each resource through the request or data path it controls.
- Distinguish Service port from the application target port.
- Choose Route TLS behavior from the required connection boundaries.
- Treat a bound volume claim as one storage condition, not an application test.
- Explain configuration consumption and access separately.
Table of Contents
- What is the difference between a Pod and a Service?
- How would you explain port and targetPort with a worked example?
- How is an OpenShift Route different from a Service?
- How do PV, PVC and StorageClass differ?
- When should an answer choose ConfigMap or Secret?
- Does creating a project automatically isolate all network traffic?
- How should you answer the complete catalog case?
- References
What is the difference between a Pod and a Service?
A Pod is the execution unit for one or more containers sharing its lifecycle and relevant resources. A Service provides a stable way to address a set of backends under its configuration. Replacing a Pod can change its address without requiring consumers to track that individual Pod.
The Service reference describes selectors, endpoints and port mapping. A label match does not itself prove the selected application listens on the expected port or is ready to handle the intended request.
Interview question: catalog has three running Pods, so why might its Service still fail? Check the selected backends, readiness, Service port and target port, then the listener and applicable network policy. The number of running processes alone does not establish a complete traffic path.
How would you explain port and targetPort with a worked example?
A Service port is the port offered by the Service. Its targetPort identifies the backend port, either numerically or by a named container port. Different values are normal when the mapping is intentional.
For the fictional catalog case, the supplied Pod specification names its 8080 port web. One Service refers to web, while an older Service still refers to http. This checked offline Python exercise resolves only the supplied names. It does not inspect selectors, EndpointSlices, listeners or real traffic.
pod_ports = {"web": 8080, "metrics": 9090}
service_targets = {"catalog": "web", "old-catalog": "http"}
for service, target_name in service_targets.items():
resolved = pod_ports.get(target_name)
if resolved is None:
print(service + ": unresolved target " + target_name)
else:
print(service + ": target=" + str(resolved))Expected output:
catalog: target=8080 old-catalog: unresolved target http
The result identifies a name mismatch in the invented input. A real review must also verify that the process listens on 8080 and that the selected backends are appropriate. Declaring containerPort documents a port; it does not cause an application to bind a socket.
How is an OpenShift Route different from a Service?
A Route describes an external entry to a Service through the configured OpenShift routing infrastructure. The OpenShift Route guide documents HTTP and supported TLS routing behavior. A Service can exist without an externally exposed Route.
Question: when would you choose edge, re-encrypt or passthrough TLS? Edge termination ends the client TLS connection at the router. Re-encrypt uses a separate TLS connection toward the backend. Passthrough leaves TLS termination to the destination, subject to the routing requirements.
For catalog, ask where certificates should be served and which connections need protection. Merely saying the Route uses HTTPS does not establish encryption on every hop. Also distinguish DNS and certificate-name problems from unavailable Service backends before changing the application.
| Resource or setting | Question it answers | Catalog example |
|---|---|---|
| Pod container port name | Which backend name is declared? | web refers to 8080 |
| Service targetPort | Where should Service traffic go? | web resolves; http does not in the supplied case |
| Route target and TLS mode | How does external traffic enter? | Chosen according to certificate and backend requirements |
| Readiness | Should a backend receive normal traffic? | A running instance can still be unready |
How do PV, PVC and StorageClass differ?
A PersistentVolume represents storage made available to the cluster. A PersistentVolumeClaim is a user's request for storage. A StorageClass describes provisioner-related storage choices and parameters, with behavior depending on the installed driver and configuration.
The persistent volume guide explains their lifecycle and access modes. Names such as fast or standard are administrative choices, not universal classes that every OpenShift cluster provides. Inspect the actual storage classes and the application's requirements.
Question: a PVC is Bound; does that prove catalog can write its data? No. Binding is one stage. Attachment, mounting, filesystem access and the application's behavior still need appropriate checks. Also ask about reclaim policy and backup arrangements before assuming data survives every deletion or failure.
When should an answer choose ConfigMap or Secret?
Use a ConfigMap for non-confidential configuration. Use a Secret for sensitive values under appropriate access and storage controls. The Secret guidance warns that encoding a value with Base64 does not make it confidential.
The ConfigMap guide explains consumption differences. Environment-variable values in an existing process do not automatically change when the ConfigMap changes. Mounted projections and application reload behavior require their own explanation.
In catalog, a non-sensitive page-size setting can be configuration, while a backend credential needs controlled handling. Ask who can read the resource and who can create workloads that consume it. Avoid including real credentials in interview notes or a demonstration manifest, even when the resource is called Secret.
Does creating a project automatically isolate all network traffic?
A project supplies a management and authorization boundary, but network isolation depends on applicable policy and the network implementation. The OpenShift network policy guide describes policy objects used to control workload traffic.
The Kubernetes NetworkPolicy guide explains that ordinary NetworkPolicy allow rules combine additively. For a connection affected by both sides' policies, source egress and destination ingress must permit it. A missing rule on one side can still prevent communication.
Question: catalog can reach one database but not another in the same project; what would you inspect? Identify the selected Pods, addresses, ports and applicable policy before assuming project membership grants access. Application authentication and Service resolution are additional checks, not replacements for network-policy analysis.
| Interview statement | Better answer cue | Evidence needed |
|---|---|---|
| The PVC is bound, so storage works | Binding precedes application I/O validation | Mount result, identity and controlled application check |
| The Secret is encoded, so nobody can read it | Encoding is reversible representation | Read access, workload permissions and storage controls |
| The Route is secure | Identify each TLS termination boundary | Route mode, certificates and backend configuration |
| The project isolates everything | Review actual policy for both directions | Selectors, applicable rules and network implementation |
How should you answer the complete catalog case?
Start with the supplied inconsistency: the old Service names a target absent from the declared Pod ports. Correct the intended configuration through the team's supported workflow, then validate the selected endpoints and application listener in an approved environment.
Continue outward through the Route, DNS and TLS requirements, and inward through configuration and storage access. This order follows the particular evidence; it is not a fixed command sequence for every incident.
When the interviewer changes one fact, reconsider only the affected explanation. If both target names resolve but a request is denied, a port-name mismatch no longer explains that denial. Ask for the response source and access requirements. Good foundational answers show which conclusion each observation supports and what remains to be checked.
Related reading: OpenShift architecture questions; OpenShift failure diagnosis; OpenShift access-control questions.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0