docs: document ResourceQuota interaction for init container accounting. - #2535
Conversation
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe design documents Kubernetes ChangesResourceQuota accounting documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Possibly related issues
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/develop/initContainer-design.md (2)
270-271: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winQualify enforcement by the ResourceQuota admission plugin.
A
ResourceQuotaobject is enforced only when the API server enables theResourceQuotaadmission plugin. Add this condition to avoid overstating behavior on clusters where the object exists but the plugin is disabled. (kubernetes.io)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/develop/initContainer-design.md` around lines 270 - 271, Update the ResourceQuota enforcement description in the kube-apiserver flow to state that the quota is checked before HAMi only when the ResourceQuota admission plugin is enabled; retain the existing behavior description for enabled-plugin clusters.Source: MCP tools
270-273: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winClarify that HAMi and Kubernetes can calculate different numeric values.
pkg/scheduler/webhook.go:145-192applies HAMi-specific defaults, memory factors, and rounding beforeFitQuota. Kubernetes calculates quota from Pod resource requests. Themax(sum(app), max(init))rule is structurally shared, but the resulting values can differ. State this explicitly. (kubernetes.io)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/develop/initContainer-design.md` around lines 270 - 273, Update the ResourceQuota explanation near the `max(sum(app), max(init))` formula to state that HAMi and Kubernetes may produce different numeric values: HAMi applies its defaults, memory factors, and rounding before `FitQuota`, while Kubernetes uses the Pod’s resource requests. Preserve the distinction that both share the same structural max rule.Source: MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/develop/initContainer-design.md`:
- Around line 273-280: Update the ResourceQuota explanation in the
init-container design text to state that usage is charged while the Pod is
non-terminal, not until deletion or for its whole lifetime. Preserve the example
and clarify that Succeeded and Failed Pods no longer count toward quota while
their objects remain.
---
Nitpick comments:
In `@docs/develop/initContainer-design.md`:
- Around line 270-271: Update the ResourceQuota enforcement description in the
kube-apiserver flow to state that the quota is checked before HAMi only when the
ResourceQuota admission plugin is enabled; retain the existing behavior
description for enabled-plugin clusters.
- Around line 270-273: Update the ResourceQuota explanation near the
`max(sum(app), max(init))` formula to state that HAMi and Kubernetes may produce
different numeric values: HAMi applies its defaults, memory factors, and
rounding before `FitQuota`, while Kubernetes uses the Pod’s resource requests.
Preserve the distinction that both share the same structural max rule.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1b57acd6-a558-4cf5-b036-2b376cbe18e2
📒 Files selected for processing (1)
docs/develop/initContainer-design.md
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
|
@DSFans2014 and @archlitchi i updated the docs as discussed in the #1773 (comment) can you please review this. |
|
/lgtm |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: FouoF, maishivamhoo123 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Thia Pr will close the #2533
Added a section to
docs/develop/initContainer-design.mdexplaining theresource-calculation difference between quota-enabled and non-quota scenarios.
As suggested by @DSFans2014 and @archlitchi in #1773 Comment
HAMi shrinks usage after init containers complete, while the kube-apiserver's ResourceQuota plugin holds the effective request for the pod's entire lifetime.
Summary by CodeRabbit
ResourceQuotaaccounts for pod resources when init containers are present.