OpenShift Job Interview Questions on Capacity and Scheduling
Capacity questions in an OpenShift job interview should distinguish admission limits, scheduling requirements and measured resource use. Explain why a Pod can remain Pending even when graphs show spare CPU, and why adding replicas can increase pressure instead of solving a problem.
Topic: OpenShift in IT Infrastructure · Interview preparation
Quick answer: Capacity questions in an OpenShift job interview should distinguish admission limits, scheduling requirements and measured resource use. Explain why a Pod can remain Pending even when graphs show spare CPU, and why adding replicas can increase pressure instead of solving a problem. The original practice questions here follow an invented worker-pool case with enough aggregate CPU but no single node large enough for one request. Product references use OpenShift Container Platform 4.22, with upstream documentation used for the stated scheduling and autoscaling concepts.
Key takeaways
- Compare requests with eligible-node capacity, not only usage graphs.
- Check project quota before assuming a Pod reached scheduling.
- Treat tolerations as permission to consider a node, not placement guarantees.
- Explain what an autoscaler measures and what it can change.
- Keep availability and data placement in a capacity decision.
Table of Contents
- How do requests, limits and actual usage differ?
- How is a quota rejection different from an unschedulable Pod?
- Why can aggregate spare CPU still be unusable for one Pod?
- Do tolerations and affinity guarantee that a Pod will run?
- What can HPA solve, and what does it leave unchanged?
- How do rollout and storage requirements affect capacity planning?
- How should you present the capacity decision in an interview?
- References
How do requests, limits and actual usage differ?
A request describes the resource requirement used in scheduling and allocation. A limit constrains runtime consumption according to the resource and implementation. Actual usage is a measurement that can change throughout the day. The resource management guide explains CPU units, scheduling checks and runtime behavior.
Interview question: why can an almost idle node reject another Pod? Existing resource requests can consume its allocatable scheduling budget even when those workloads currently use little CPU. Other placement constraints can also make that node unsuitable.
Use the workload's effective requests and the node's allocatable resources after relevant reservations. For a multi-container Pod, account for its components under the supported platform rules. A graph showing host CPU utilization does not substitute for that placement calculation.
How is a quota rejection different from an unschedulable Pod?
A resource quota can reject creation when a project would exceed a configured total. The OpenShift quota guide documents aggregate requests, limits and object counts. It can also require explicit values for specified resources.
If the request is rejected, there may be no new Pod for a scheduler to place. If a Pod exists but remains unassigned, inspect its scheduling conditions and events. These are different points in the workflow and need different evidence.
Question: does increasing project quota create more physical CPU? It changes an admission allowance. It does not add nodes, enlarge a machine or remove an affinity requirement. Conversely, adding a node does not automatically raise the project's quota. Explain both limits before recommending either change.
| Constraint | Where it affects the decision | Evidence to request |
|---|---|---|
| Project quota | Whether resource creation is admitted | Quota usage, configured hard limits and rejection |
| Node resource fit | Whether a Pod fits an eligible node | Effective requests and allocatable requested capacity |
| Taint or affinity | Which nodes are candidates | Pod placement requirements and node attributes |
| Storage placement | Whether the volume and Pod can align | Storage class, claim state and topology constraints |
Why can aggregate spare CPU still be unusable for one Pod?
In a fictional case, worker-a and worker-b each have 600 millicpu remaining for this exercise. A Pod requesting 1000 millicpu cannot combine the two nodes into one execution location. A request of 500 millicpu passes this simplified CPU check on either node.
This checked offline Python example compares integers representing already-calculated remaining CPU. It is not a Kubernetes quantity parser or scheduler. It ignores memory, existing placement rules, storage, overhead and changes while scheduling occurs.
free_cpu_m = {"worker-a": 600, "worker-b": 600}
for requested_m in (1000, 500):
candidates = [name for name, free in free_cpu_m.items()
if free >= requested_m]
print("request=" + str(requested_m) + "m candidates="
+ (",".join(candidates) or "none"))
print("aggregate=" + str(sum(free_cpu_m.values())) + "m")Expected output:
request=1000m candidates=none request=500m candidates=worker-a,worker-b aggregate=1200m
The aggregate is 1200 millicpu, but the 1000 millicpu request has no candidate. A candidate for the smaller request only passes this one check. If the application really needs the larger request, reducing it merely to force placement can create an operational problem. Confirm its resource needs and consider a suitable node pool.
Do tolerations and affinity guarantee that a Pod will run?
A toleration allows consideration of a node with a matching taint. The taints and tolerations guide explicitly says this does not guarantee scheduling because other parameters still apply. Required affinity can narrow the eligible set further.
Question: a Pod tolerates the dedicated-workload taint but is still Pending; what next? Check whether its required node labels match, whether any matching node has capacity, and whether volume placement permits that node. Do not remove isolation rules just to make the symptom disappear.
In the worker-pool exercise, suppose only worker-a has the required label. Worker-b's spare CPU is irrelevant to that Pod even if its usage is lower. A useful answer identifies the candidate set before totaling its resources.
What can HPA solve, and what does it leave unchanged?
A HorizontalPodAutoscaler adjusts a supported workload's desired replica count from configured metrics. The autoscaling guide explains that a CPU utilization target uses usage relative to the relevant resource requests. The metrics and requests must be suitable for the calculation.
HPA does not directly enlarge nodes or guarantee that new replicas can be scheduled. If each new replica requests more CPU than any eligible node can provide, increasing the desired count produces more unmet demand. Cluster capacity automation is a separate mechanism with its own prerequisites and constraints.
Question: why might more replicas fail to improve latency? The bottleneck could be a shared database, a queue or another dependency. Ask which metric represents demand and whether the application can use additional independent instances.
How do rollout and storage requirements affect capacity planning?
A rollout may temporarily need additional replicas. The Deployment guide describes surge and unavailability settings. Calculate the temporary request budget as well as the steady-state total, then check placement constraints for both versions.
Storage can add a separate restriction. The persistent volume guide describes access modes and storage relationships. ReadWriteOnce generally concerns use from one node; it does not universally mean one Pod. Driver and topology behavior must match the actual workload.
For the worker-pool case, a replacement Pod might pass CPU fit on worker-b but be unable to use the required volume there. A CPU-only calculation cannot establish the release plan. Ask the storage owner about supported attachment, topology and recovery behavior.
| Proposed response | Question before approving it | Reason |
|---|---|---|
| Reduce the CPU request | What measurement supports the new requirement? | Placement success can conceal resource contention |
| Raise HPA maximum | Can eligible nodes host the additional replicas? | Desired replicas do not create capacity |
| Increase project quota | Was admission actually the blocking stage? | An unrelated limit may remain |
| Move a stateful replica | Can its storage and application operate there? | CPU fit alone omits data constraints |
How should you present the capacity decision in an interview?
State the supplied facts first: two nodes each offer 600 millicpu for this simplified exercise, while the new Pod requests 1000. Conclude that aggregate capacity is insufficiently concentrated for that request. Then name the omitted checks before proposing a production action.
Offer alternatives tied to evidence. A suitable larger node may address the fit problem. Rebalancing could help if supported placement and disruption constraints permit it. An application redesign could split work, but that is an engineering change rather than a scheduler switch.
Close the answer with how you would validate the chosen response: successful admission, assignment to an appropriate node, stable application behavior and acceptable impact on other workloads. This gives the interviewer a capacity decision they can challenge instead of a generic promise to scale the cluster.
Related reading: OpenShift architecture questions; OpenShift rollout acceptance; Common OpenShift failure questions.
References
Frequently Asked Questions
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Wow
0
Sad
0
Angry
0