Lease and Reservation Control Planes
Arbitrating scarce, non-fungible resources — a GPU zone, a hardware bench, a test cluster — with time-bounded leases: why leases must expire, fencing tokens, queueing and fairness, preemption, and modelling the whole thing as a CRD plus controller.
Overview
Scarce, non-fungible resources
Some resources cannot be autoscaled: a GPU zone with a specific interconnect topology, a hardware bench with one board on it, a test cluster pinned to the Kubernetes version an upgrade must be validated against, a vendor sandbox with a single account. There is a fixed number of them, they are not interchangeable, and no API call makes another one appear this afternoon.
Every organization that owns hardware ends up building an arbitration layer for them. Most build it badly at first: a spreadsheet, a Slack channel, a convention that you rename the machine to your username. A good one has the shape below, and the rest of this chapter takes its pieces in turn.
Key concepts
- Lease versus lock
- Kubernetes Lease object
- Node heartbeat leases
- Leader election timing
- Fencing token
- Renewal, TTL, and grace period
- Queue discipline and starvation
- Preemption with checkpointing
Interview questions
- Why must a lease expire, and what exactly goes wrong with a lock that does not?
- Explain fencing tokens. Why is a lease with a timeout not sufficient on its own?
- Design a lease and reservation control plane as a CRD plus controller. What are the types and what does the reconcile loop do?
- How do you handle queueing, fairness, and starvation across teams sharing one pool?
- How do you preempt a lease without corrupting in-flight work, and how do reservations and overcommit fit in?
- What do you instrument, and how do you use those metrics to answer whether to buy more hardware?
Sign up free to read the full topic
More DevOps topics
- Kubernetes Security: Pod Security and Runtime Hardening
- Kubernetes Services
- Kubernetes Storage
- Kubernetes the Hard Way
- Kubescape and Kubernetes Runtime Security
- Kustomization and Reconciliation
- libstdc++, libc++, glibc and Symbol Versioning
- Lifecycle Hooks and Tests
- Linking Deep Dive
- Linux Cron & Task Scheduling
- Local Kubernetes Cluster Setup (minikube / kind / k3d)
- Log Aggregation
Start free on Cariara · Coding problems · System design studio