← Back to Pull requests

fix(chart): remove unused webhook.gpuShareResources value #30

Open
blackdragoon26 opened this pull request with 10 lines diff across 4 files
View on GitHub
blackdragoon26 blackdragoon26 commented on Sep 26, 2026 14:06 UTC
Author

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-resources flag, the getenv("GPU_SHARE_RESOURCES", ...) call and all resource-key filtering from cmd/webhook/main.go, switching injection to the KAI gpu-fraction / gpu-memory annotations. The chart kept the value, so operators set a knob that does nothing.

This PR removes webhook.gpuShareResources from chart/kai-resource-isolator/values.yaml and GPU_SHARE_RESOURCES from chart/kai-resource-isolator/templates/webhook-deployment.yaml, corrects NOTES.txt step 3 to the real trigger and target-container rule (both documented opt-outs kept), and removes the webhook.gpuShareResources row from the README.md Customization table. No Go code, no other env var or values entry; HOST_VGPU_DIR is 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.md at v0.18.0 never referenced the value.

This branch has been updated with the latest main through 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's main is 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 template at defaults and with monitor.enabled=true,monitor.serviceMonitor.enabled=true,tls.certManager.enabled=true,tls.patch.enabled=false, and go test ./... (5 packages) all pass; the main-vs-branch render diff is exactly the two removed GPU_SHARE_RESOURCES lines, live webhook env is exactly CONTAINER_VGPU_MOUNT and HOST_VGPU_DIR, and helm get manifest | grep -c GPU_SHARE_RESOURCES is 0 (was 1 on main).

A gpu-fraction: "0.5" pod with no extended resources got the /usr/local/vgpu, /usr/local/vgpu/containers and /tmp/vgpulock volumes, the /etc/ld.so.preload subPath mount and env POD_UID / CONTAINER_NAME / CONTAINER_VGPU_MOUNT (injected), while the same pod with kai-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.gpuShareResources Helm setting is no longer available.

Documentation
Updated chart notes to explain that webhook injection applies to pods annotated with gpu-fraction or gpu-memory. Injection targets the container named by gpu-fraction-container-name; when that annotation is absent, it targets the first container.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Diff: 10 lines (+3 / -7) across 4 files Reviewer: archlitchi Review duration: 17505m
All Vouch review confidence checks passed
Residual risk 0.06 = Change Risk (0.22) × (1 − Review Confidence (0.72)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.22 · 10 lines diff across 4 files
0.22
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.58 · 3 substantive comment(s)
0.58
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
71%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.143
Real PR Conversation Timeline
5 items
coderabbitai[bot] coderabbitai[bot] commented on Sep 26, 2026 14:06 UTC
Bot

<!-- 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

  • chart/kai-resource-isolator/values.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

  • _observed_ — chart (service) was modified; 3 changed files map to changed impact.

  • _observed_ — README.md (service) was modified; 1 changed file maps to changed impact.
  • Before / after behavior

  • _observed_ — Modified behavior in README.md: Removed the 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.

  • _observed_ — Modified behavior in chart/kai-resource-isolator/templates/NOTES.txt: The injection instructions replace the 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.

  • _observed_ — Modified behavior in chart/kai-resource-isolator/templates/webhook-deployment.yaml: The GPU_SHARE_RESOURCES environment variable and its value sourced from .Values.webhook.gpuShareResources were removed from the webhook container.

  • _observed_ — Modified behavior in chart/kai-resource-isolator/values.yaml: Removed 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>

  • <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create a new PR
  • </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>

  • X

  • Mastodon

  • Reddit

  • LinkedIn
  • </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 -->

    archlitchi archlitchi approved these changes on Sep 28, 2026 03:50 UTC
    Approved Reviewer

    /lgtm

    hami-robot[bot] hami-robot[bot] commented on Sep 28, 2026 03:50 UTC
    Bot

    [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:

  • ~~OWNERS~~ [archlitchi]
  • 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":[]} -->

    hami-robot[bot] hami-robot[bot] commented on Sep 28, 2026 18:54 UTC
    Bot

    New changes are detected. LGTM label has been removed.

    Reviewers
    Assignees
    blackdragoon26 blackdragoon26
    Labels
    risk: low confidence: 71.6% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 21.7% (LOW) · Higher = larger blast radius
    21.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 71.6% · Lower = rushed or shallow review
    71.6%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 6.2% · Safe to merge
    6.2%