fix(chart): remove unused webhook.gpuShareResources value #30
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- review_stack_entry_start -->
<a href="https://app.coderabbit.ai/change-stack/Project-HAMi/KAI-resource-isolator/pull/30?cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a>
Navigate logical layers of code changes, visualize relationships, and explore their blast radius.
<!-- review_stack_entry_end -->
<!-- recent_review_start -->
No actionable comments were generated in the recent review. 🎉
<details>
<summary>ℹ️ Recent review info</summary>
<details>
<summary>⚙️ Run configuration</summary>
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: 4ae6eed6-7fc9-4faf-accd-ab6949df1e05
</details>
<details>
<summary>📥 Commits</summary>
Reviewing files that changed from the base of the PR and between 09c0bb90b360503ac3ec5ca987d07fcae852ae0a and 6e551125ca18cb4bedd76aafc193152367a48302.
</details>
<details>
<summary>📒 Files selected for processing (4)</summary>
README.md
chart/kai-resource-isolator/templates/NOTES.txt
chart/kai-resource-isolator/templates/webhook-deployment.yaml
chart/kai-resource-isolator/values.yaml
</details>
<details>
<summary>💤 Files with no reviewable changes (3)</summary>
README.md
chart/kai-resource-isolator/templates/webhook-deployment.yaml
</details>
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
</details>
---
<!-- recent_review_end -->
<!-- walkthrough_start -->
<details>
<summary>📝 Walkthrough</summary>
Walkthrough
The chart removes the unused webhook.gpuShareResources value and its Deployment environment variable. The chart notes now describe injection based on gpu-fraction or gpu-memory annotations and identify the target container.
Changes
Chart setting and injection guidance
|Layer / File(s)|Summary|
|---|---|
|Remove setting and document annotation triggers <br> chart/kai-resource-isolator/values.yaml, chart/kai-resource-isolator/templates/webhook-deployment.yaml, chart/kai-resource-isolator/templates/NOTES.txt, README.md|The chart removes webhook.gpuShareResources and the corresponding GPU_SHARE_RESOURCES environment variable. The notes describe annotation-based injection and the target container. The README no longer lists the setting.|
<!-- change_assessment_start -->
Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~8 minutes
<!-- change_assessment_commit:"6e551125ca18cb4bedd76aafc193152367a48302" -->
Change: Bug fix · Severity of issue fixed: Low
<!-- change_assessment_end -->
Suggested reviewers: archlitchi
</details>
<!-- walkthrough_end -->
<!-- final_review_risk_start -->
Merge Risk: _⚪ Minimal_ · up to 6e551
<!-- final_review_risk_coverage:{"sourceCommitId":"6e551125ca18cb4bedd76aafc193152367a48302","coveredCommitId":"6e551125ca18cb4bedd76aafc193152367a48302","kind":"reviewed"} -->
This removes an unused chart setting and documents the existing annotation-based injection behavior; no material merge risk remains.
<!-- final_review_risk_end -->
<!-- architecture_review_start -->
Architecture Summary
Architecture risk: _🔵 Low_ · up to 6e551
The change affects 2 systems.
Changed systems: chart, README.md
Architecture concerns
No architecture-level concerns identified.
<details>
<summary>Review details</summary>
Systems and components
Before / after behavior
webhook.gpuShareResources row, which documented the default extended-resource list passed to the webhook and stated that injection is keyed to the gpu-fraction/gpu-memory annotations rather than those resources.webhook.gpuShareResources request criteria with the gpu-fraction or gpu-memory annotations and specify the target container: the one named by gpu-fraction-container-name, or the first container if that annotation is absent.GPU_SHARE_RESOURCES environment variable and its value sourced from .Values.webhook.gpuShareResources were removed from the webhook container.webhook.gpuShareResources, which configured the comma-separated nvidia.com/gpu, nvidia.com/gpumem, and nvidia.com/gpucores resources that trigger injection.</details>
<!-- architecture_review_end -->
<!-- pre_merge_checks_walkthrough_start -->
<details>
<summary>🚥 Pre-merge checks | ✅ 5</summary>
<details>
<summary>✅ Passed checks (5 passed)</summary>
| Check name | Status | Explanation |
| :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Linked Issues check | ✅ Passed | Issue #26 requires removal of the unused webhook.gpuShareResources setting and documentation of annotation-based injection. The PR removes the value from values.yaml, removes GPU_SHARE_RESOURCES… |
| Out of Scope Changes check | ✅ Passed | The reviewed changes are limited to the chart value removal, Deployment environment-variable removal, and related README and Helm notes updates. The notes also document the existing namespace opt-out.… |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0… |
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title clearly and concisely describes the main change: removing the unused webhook.gpuShareResources chart value. |
</details>
</details>
<!-- pre_merge_checks_walkthrough_end -->
<!-- finishing_touch_checkbox_start -->
<details>
<summary>✨ Finishing Touches</summary>
<details open>
<summary>🧪 Generate unit tests (beta)</summary>
</details>
</details>
<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->
---
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.
<details>
<summary>❤️ Share</summary>
</details>
<!-- poem_footer_start -->
<sub>A rabbit nibbles at the chart,<br>The unused setting departs.<br>Two annotations mark the way,<br>The notes now name where changes stay.<br>I thump my paws and hop away!</sub>
<!-- poem_footer_end -->
<sub>Comment @coderabbitai help to get the list of available commands.</sub>
<!-- tips_end -->
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: <a href="https://github.com/Project-HAMi/KAI-resource-isolator/pull/30#pullrequestreview-5333777028" title="LGTM">archlitchi</a>, <a href="https://github.com/Project-HAMi/KAI-resource-isolator/pull/30#" title="Author self-approved">blackdragoon26</a>
The full list of commands accepted by this bot can be found here.
The pull request process is described here
<details >
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
New changes are detected. LGTM label has been removed.
archlitchi
blackdragoon26
What type of PR is this?
Bug fix / cleanup. Removes a chart value and an env var the webhook binary no longer reads, plus the docs advertising them.
What this PR does / why we need it:
PR #1 (https://github.com/Project-HAMi/KAI-resource-isolator/pull/1, "update admission enable rules", merged) removed the
--gpu-resourcesflag, thegetenv("GPU_SHARE_RESOURCES", ...)call and all resource-key filtering fromcmd/webhook/main.go, switching injection to the KAIgpu-fraction/gpu-memoryannotations. The chart kept the value, so operators set a knob that does nothing.This PR removes
webhook.gpuShareResourcesfromchart/kai-resource-isolator/values.yamlandGPU_SHARE_RESOURCESfromchart/kai-resource-isolator/templates/webhook-deployment.yaml, correctsNOTES.txtstep 3 to the real trigger and target-container rule (both documented opt-outs kept), and removes thewebhook.gpuShareResourcesrow from theREADME.mdCustomization table. No Go code, no other env var or values entry;HOST_VGPU_DIRis a separate observation, left alone.Which issue(s) this PR fixes:
Fixes #26
Special notes for your reviewer:
Removal, not re-implementation: re-adding the env as a resource filter would undo PR #1's stated intent, "KAI-scheudler use annotation instead of resource to use gpu-sharing, so the webhook should follow it." KAI's
docs/gpu-sharing/hami/README.mdat v0.18.0 never referenced the value.This branch has been updated with the latest
mainthrough a merge commit, which is what resolved the README conflict: the other contributor's README rewrite (their PR #23) landed after this pull request was opened, and it turned the Customization section from a sentence into a table. The resolution keeps the merged README and removes only the dead table row, so the net diff against today'smainis the same four files with 3 insertions and 7 deletions.Verified on a single-node kind v0.32.0 cluster (Kubernetes v1.36.1, no GPU) with the chart installed at
image.tag=v1.1.0:helm lint,helm templateat defaults and withmonitor.enabled=true,monitor.serviceMonitor.enabled=true,tls.certManager.enabled=true,tls.patch.enabled=false, andgo test ./...(5 packages) all pass; the main-vs-branch render diff is exactly the two removedGPU_SHARE_RESOURCESlines, live webhook env is exactlyCONTAINER_VGPU_MOUNTandHOST_VGPU_DIR, andhelm get manifest | grep -c GPU_SHARE_RESOURCESis0(was1on main).A
gpu-fraction: "0.5"pod with no extended resources got the/usr/local/vgpu,/usr/local/vgpu/containersand/tmp/vgpulockvolumes, the/etc/ld.so.preloadsubPath mount and envPOD_UID/CONTAINER_NAME/CONTAINER_VGPU_MOUNT(injected), while the same pod withkai-resource-isolator.io/inject: "false"got zero injected volumes (skipped: annotation kai-resource-isolator.io/inject=false). No GPU was available, so only admission-time injection was exercised.Does this PR introduce a user-facing change?:
Yes, small.
--set webhook.gpuShareResources=...becomes an unknown value ignored by Helm instead of silently rendered into the Deployment. Anyone who set it saw no behavioural change before, so no working configuration is affected.AI Disclosure:
AI assistance was used to review repository context and help draft this change and its description. All changes were manually reviewed, verified locally, and submitted by the author.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Configuration
The
webhook.gpuShareResourcesHelm setting is no longer available.Documentation
Updated chart notes to explain that webhook injection applies to pods annotated with
gpu-fractionorgpu-memory. Injection targets the container named bygpu-fraction-container-name; when that annotation is absent, it targets the first container.<!-- end of auto-generated comment: release notes by coderabbit.ai -->