Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion docs/develop/initContainer-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,19 @@ The terminal-phase release is not persisted as a separate state — it's
recomputed on every reconcile directly from `pod.Status.Phase`:

if pod.Status.Phase in (Succeeded, Failed):
usage = 0
usage = 0

## Interaction with Kubernetes ResourceQuota

If the namespace has a `ResourceQuota` (like `requests.nvidia.com/gpumem`), the
kube-apiserver checks it first, before the pod reaches HAMi. The apiserver uses the
same formula `max(sum(app), max(init))`, but it charges this value only once, when
the pod is created, and it keeps the charge while the pod is non-terminal (released
once the pod reaches `Succeeded`/`Failed` or is deleted). It does not react when
init containers finish, so the shrink in this design only frees capacity inside
HAMi. The apiserver quota is not released at that point.

Because of this, the same pods can run fine without a quota but fail when a quota is
set. Example: quota is 10000. Pod A (init 8000, app 5000) is charged 8000 for as
long as it stays non-terminal, even after its init container exits. Pod B (effective 5000) gets rejected with `exceeded quota: ... used: 8k` before HAMi even sees it. This is normal Kubernetes behavior and HAMi cannot change it.

Loading