Representative interview topic

System design interview: How would you use Kubernetes v1.36 DRA for Node Allocatable resources?

System designHard
Offer.cc Editorial TeamPublished Updated

Question

A DRA driver allocates accelerators but also consumes CPU, memory, or hugepages. Design Node Allocatable accounting that avoids double counting DRA allocations and ordinary Pod requests.

Question and scope

A multi-tenant inference cluster allocates accelerators through Dynamic Resource Allocation (DRA). The driver consumes CPU, memory, or hugepages per device, and some devices require NUMA alignment. Design a Kubernetes v1.36 Node Allocatable plan so the scheduler accounts for DRA allocations and ordinary Pod requests together. Explain ResourceSlice mappings, Pod status, rollout, monitoring, and rollback boundaries.

The official v1.36 DRA update describes Node Allocatable resources as a first iteration that brings DRA-managed CPU, memory, and hugepages into standard node accounting. The capability is still alpha, so the design needs experimental-feature guardrails.

Context and boundaries

This question focuses on pre-scheduling resource accounting, topology constraints, and release safety. Hardware allocation inside the driver and business-level fault tolerance are external dependencies; the answer should state the API version, feature gate, freshness policy, ledger consistency, and rollback conditions.

What the interviewer tests

  • Whether you can connect the resource ledger, scheduler, DRA driver, ResourceSlice, and Pod status.
  • Whether you distinguish device capacity from node resources consumed by a device allocation and from ordinary Pod requests.
  • Whether you handle NUMA, hugepages, out-of-order updates, driver restarts, and stale ResourceSlices.
  • Whether you can roll out an alpha feature gate with canaries, observability, rollback, and old-driver compatibility.
  • Whether status updates are restricted to DRA synthetic subresources and node-scoped permissions.

30-second answer

“I would have the DRA driver declare each device’s CPU, memory, or hugepage contribution in nodeAllocatableResourceMappings on a ResourceSlice. The scheduler merges allocations from bound claims with ordinary Pod requests in the node ledger, counting each claim once. A fixed footprint can use allocationMultiplier; a capacity-based footprint can use capacityKey. Pod status exposes the result through nodeAllocatableResourceClaimStatuses. I would enable DRANodeAllocatableResources only on canary nodes, test NUMA, stale updates, and pending behavior, and stop new claims if the ledger or mapping becomes unsafe.”

Step-by-step solution

  1. Define the resource model. Store device ID, ResourceClaim, node, NUMA zone, resource name, unit, mapping version, and observation time in a replayable ledger. Separate device capacity from CPU, memory, and hugepage consumption; a claim must enter the ledger once.
  1. Publish ResourceSlice mappings. The DRA driver writes nodeAllocatableResourceMappings in a ResourceSlice. Mapping keys can represent CPU, memory, ephemeral-storage, or hugepages. A fixed per-device footprint can be represented with allocationMultiplier; capacity-based consumption can use capacityKey.
yaml
resourceSlice:
  nodeAllocatableResourceMappings:
    cpu:
      allocationMultiplier: 2
    memory:
      allocationMultiplier: 4Gi
    hugepages-2Mi:
      capacityKey: consumed

This illustrates mapping semantics only. Field types and units must be checked against the current Kubernetes API schema and driver implementation; it is not a submit-ready object.

  1. Merge the scheduling ledger. The scheduler reads ResourceSlices and bound ResourceClaims, calculates the DRA contribution, and adds ordinary Pod requests. Use a stable claim key for deduplication. If a ResourceSlice is stale or its mapping is missing, keep new Pods pending and alert instead of scheduling against old capacity.
  1. Handle NUMA and ordering. Record NUMA affinity and versions. Commit an allocation, release, or ResourceSlice update only when the node’s version ordering is monotonic. During a driver restart, rebuild mappings before accepting new claims to avoid temporary double allocation.
  1. Expose status and telemetry. Pod status.nodeAllocatableResourceClaimStatuses records the claim’s node-resource status. Track ledger capacity, usage, mapping age, pending reasons, duplicate-rejection count, and NUMA placement failures. Correlate status writes and scheduling decisions with the claim UID.
  1. Canary and rollback. After control-plane, scheduler, and driver compatibility is confirmed, enable DRANodeAllocatableResources only for canary nodes. Test ResourceSlices, ordinary Pods mixed with claims, node restarts, driver upgrades, and release. On failure, stop new claims, preserve existing bindings, export the ledger, repair mappings, and resume by version. Do not assume every cluster can safely enable an alpha capability.
  1. Security boundary. Give the DRA driver only the synthetic-subresource permissions needed for its status updates. Node-local drivers use node-aware verbs and least-privilege RBAC. Failed writes should alert and retry; expanding permissions does not repair ledger inconsistency.

Model answer

I would treat Node Allocatable as a versioned resource ledger. The driver declares device contributions to CPU, memory, or hugepages in nodeAllocatableResourceMappings; fixed contributions use allocationMultiplier, and capacity-based contributions use capacityKey. The scheduler reads bound claims, merges each claim’s contribution with ordinary Pod requests, and deduplicates by claim UID so device usage and node-resource usage are not counted twice.

The ledger records node, device, NUMA, mapping version, and observation time. During a stale ResourceSlice, version regression, or driver restart, new Pods remain pending rather than scheduling from old capacity. Pod nodeAllocatableResourceClaimStatuses supports readback and diagnosis, but it does not replace ledger consistency checks.

Because v1.36 remains alpha, I would enable DRANodeAllocatableResources on canary nodes first and test mixed claims and Pods, NUMA, node restart, release, and driver upgrades. Rollback stops new claims, preserves existing bindings, and exports the ledger before mapping repair. RBAC is limited to DRA synthetic subresources and node-scoped permissions.

Common mistakes

  • Mistake: Deduct node CPU once per device and again after a claim retry → Why it fails: no stable idempotency key → Fix: deduplicate by claim UID, device ID, and mapping version.
  • Mistake: Submit the illustrative YAML as a production API object → Why it fails: field schema and units are versioned → Fix: verify the ResourceSlice API and driver version.
  • Mistake: Continue using old capacity while a ResourceSlice is unavailable → Why it fails: stale data can overcommit → Fix: use a freshness window and keep new claims pending after expiry.
  • Mistake: Enable the alpha gate everywhere at once → Why it fails: compatibility and rollback are untested → Fix: canaries, metrics, claim admission stop, and a recoverable ledger.
  • Mistake: Expand RBAC to fix a status-write error → Why it fails: it widens authority without fixing data consistency → Fix: use synthetic subresources, node-aware verbs, and audit logs.

Follow-up questions and answers

When should you use allocationMultiplier versus capacityKey?

Use allocationMultiplier when every allocation consumes a fixed CPU or memory amount. Use capacityKey when consumption varies with device capacity or workload, with driver-defined, auditable semantics. Freeze units and versioning for either choice.

How do you avoid double counting ordinary Pod requests and DRA mappings?

Keep one ledger: ordinary requests enter the request stream, while DRA contributions enter the allocation stream keyed by claim UID. The scheduler applies each mapping once and records source and version. Duplicate keys are rejected and alerted.

Should scheduling resume immediately after a driver restart?

No. Rebuild ResourceSlices, validate bound claims, confirm monotonic versions and capacity, then admit new claims. During reconstruction, preserve existing bindings and keep new Pods pending.

How do you show that NUMA placement preserves accounting?

Replay cross-NUMA, same-NUMA, release-retry, and node-restart events. Compare the node total, NUMA sub-ledgers, and Pod status. Track placement failures, ledger divergence, pending time, and duplicate-rejection count.

When can an alpha capability be promoted?

Require compatible-driver coverage, rollback drills, node restart and upgrade replays, a zero-divergence observation window, and explicit capacity and pending SLOs. A successful build or one-node test is insufficient for a full rollout.

References

  • Kubernetes v1.36 DRA update (Kubernetes Blog)
  • Feature Gates (Kubernetes Documentation)
  • ResourceSlice API (Kubernetes Documentation)
  • Pod API (Kubernetes Documentation)
  • DRA hardening guide (Kubernetes Documentation)

Interview checklist

Draw the flow from driver to ResourceSlice, claim, scheduler, Node Allocatable ledger, and Pod status. Then add idempotency, versions, NUMA, canaries, and least privilege.

One-sentence takeaway

DRA Node Allocatable succeeds when a single, versioned, rollback-safe ledger accounts for each claim’s real node-resource contribution.

Keep practicing

Extend the mapping to multi-node ResourceClaims and explain how topology, freshness, and recovery change scheduling decisions.

Public sources

Related questions

Related interview tool

Use Solve for a system design answer

Clarify the requirements first, then move through scale, architecture, component choices, and trade-offs.

View the tool