The binder re-checks what admission checked, and cozystack-api shows the
remaining budget a later order is checked against; computing these in
three places would let them disagree. The model is pure, so each caller
builds a snapshot from its own cache.
GPU budgets cap the whole subtree of the tenant that declares them,
walked over the namespace ancestry and independent of the tenant quota
pools. A raw GPU key blocks a class until the same tenant also declares
a GPU key, and then caps claims and raw-name pods together. Pod usage
follows the scheduler's arithmetic, sidecars included, so the binder
never books a unit a raw-name pod holds.
A node serves a class only when it is schedulable, Ready and carries no
NoSchedule or NoExecute taint the class does not tolerate. The
tolerations are the class's, because a claim is bound before the pod
that will use it exists. The unschedulable, not-ready and unreachable
taints are left to the first two checks, and a taint never counts as a
cordon. Gt and Lt tolerations do not count, since the scheduler ignores
them where their feature gate is off.
Template claim names are derived from the VMI and shortened with a hash
when the VMI name leaves no room, so they stay valid subdomains.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>