Interview Prep/Kubernetes/Resources, autoscaling and scheduling

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 →

  1. Create PriorityClass objects, for example critical at 100000 and batch at 100
  2. Reference with priorityClassName
  3. The scheduler preempts lower-priority pods to fit higher ones
  4. Set preemptionPolicy: Never for pods that should queue but not evict
  5. 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.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, autoscaling and scheduling