Explain pod priority and preemption. When did you use it?
AdvancedScenarioResources, autoscaling and scheduling
Answer
Situation read → An important payment service could not schedule because batch jobs filled the cluster.
What I'd do →
- Create
PriorityClassobjects, for examplecriticalat 100000 andbatchat 100 - Reference with
priorityClassName - The scheduler preempts lower-priority pods to fit higher ones
- Set
preemptionPolicy: Neverfor pods that should queue but not evict - Protect with PDBs, although preemption tries but may violate them
Why → Priority gives deterministic behaviour under scarcity.
Interview tip → Warn that overusing high priority makes everything critical.
More on Resources, autoscaling and scheduling
How do you choose requests and limits for a new service?BeginnerPods are Pending with `0/6 nodes are available: 6 Insufficient cpu`. What do you do?IntermediateExplain QoS classes and which pods get evicted first.IntermediateCPU limits cause latency spikes though average usage is low. Why and what is the fix?IntermediateHow do you configure an HPA on CPU?BeginnerHPA shows `<unknown>/70%` for CPU. What do you do?Intermediate