Skip to content

feat(helm): machine-a-tron mac address allocation#3700

Open
akorobkov-nvda wants to merge 2 commits into
NVIDIA:mainfrom
akorobkov-nvda:feat/machine-a-tron-mac-assign
Open

feat(helm): machine-a-tron mac address allocation#3700
akorobkov-nvda wants to merge 2 commits into
NVIDIA:mainfrom
akorobkov-nvda:feat/machine-a-tron-mac-assign

Conversation

@akorobkov-nvda

Copy link
Copy Markdown
Contributor

Adds auto-generated per-pod MAC address pools to prevent collisions in multi-pod machine-a-tron deployments.

  • mac_address_pool - Standalone MACs (BMC, DPU interfaces)
  • hw_mac_address_ranges - Contiguous NIC blocks (ConnectX, storage)

Related issues

Closes #3698

Type of Change

  • Add - New feature or capability

Breaking Changes

  • This PR contains breaking changes

Testing

  • Manual testing performed

Test Results

helm template test helm/charts/nico-machine-a-tron \
  --set bmcServices.enabled=true \
  --set 'bmcServices.serviceCIDR.cidr=10.100.0.0/20' \
  --set 'pods.mat-0.cidr=10.100.0.0/22' \
  --set 'pods.mat-0.machines.compute.hwType=test' \
  --set 'pods.mat-0.machines.compute.hostCount=5' \
  --set 'pods.mat-1.cidr=10.100.4.0/22' \
  --set 'pods.mat-1.machines.compute.hwType=test' \
  --set 'pods.mat-1.machines.compute.hostCount=5' \
  2>&1 | grep -E "(mac_address_pool|hw_mac_address_ranges)" -A 3
# Pod mat-0
[mac_address_pool]
base = "02:00:00:00:00:00"
host_bits = 16

[hw_mac_address_ranges]
base = "02:01:00:00:00:00"
host_bits = 24
range_host_bits = 8

# Pod mat-1
[mac_address_pool]
base = "02:00:01:00:00:00"
host_bits = 16

[hw_mac_address_ranges]
base = "02:01:01:00:00:00"
host_bits = 24
range_host_bits = 8

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c4aaeb95-6696-4e7b-ac49-6ef08550db30

📥 Commits

Reviewing files that changed from the base of the PR and between 94eb19c and ce37eff.

📒 Files selected for processing (5)
  • docs/development/machine-a-tron-deployment.md
  • helm-prereqs/values/machine-a-tron-multipod.yaml
  • helm/charts/nico-machine-a-tron/README.md
  • helm/charts/nico-machine-a-tron/templates/configmap.yaml
  • helm/charts/nico-machine-a-tron/values.yaml
🚧 Files skipped from review as they are similar to previous changes (5)
  • helm/charts/nico-machine-a-tron/templates/configmap.yaml
  • docs/development/machine-a-tron-deployment.md
  • helm/charts/nico-machine-a-tron/values.yaml
  • helm-prereqs/values/machine-a-tron-multipod.yaml
  • helm/charts/nico-machine-a-tron/README.md

Summary by CodeRabbit

  • New Features

    • Multi-pod deployments now automatically generate disjoint per-pod MAC address pools to reduce MAC-pool conflicts.
    • Added Helm chart configuration for per-pod MAC pool and hardware MAC range auto-allocation, including options to disable auto-generation and use advanced per-pod TOML overrides.
  • Documentation

    • Updated deployment guidance and Helm chart README with clearer multi-pod examples, formatting improvements, and an expanded MAC address pool configuration reference.
    • Refreshed troubleshooting guidance for readability.
  • Bug Fixes

    • Improved deterministic per-pod MAC computation to prevent allocation inconsistencies.

Walkthrough

The Helm chart adds deterministic, configurable per-pod MAC pools and hardware MAC ranges. Values, templates, multi-pod examples, and deployment documentation now describe automatic allocation and explicit override paths.

Changes

Per-pod MAC pool allocation

Layer / File(s) Summary
MAC allocation configuration
helm/charts/nico-machine-a-tron/values.yaml, helm-prereqs/values/machine-a-tron-multipod.yaml
Adds MAC pool defaults, hardware range settings, per-pod examples, and advanced TOML override guidance.
Deterministic MAC rendering
helm/charts/nico-machine-a-tron/templates/configmap.yaml
Sorts active pods, derives pod indexes, and renders configured or automatically generated MAC pool and hardware range TOML sections.
Usage documentation
docs/development/machine-a-tron-deployment.md, helm/charts/nico-machine-a-tron/README.md
Documents generated MAC formats, multi-pod examples, configuration overrides, chart formatting, and troubleshooting guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant HelmValues
  participant ConfigMapTemplate
  participant MatToml
  HelmValues->>ConfigMapTemplate: Supply MAC defaults and pod overrides
  ConfigMapTemplate->>ConfigMapTemplate: Sort active pods and calculate podIndex
  ConfigMapTemplate->>MatToml: Render per-pod MAC pool sections
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and directly reflects the MAC address allocation feature added to the Helm chart.
Description check ✅ Passed The description matches the changeset and explains the new per-pod MAC pool generation and collision prevention.
Linked Issues check ✅ Passed The implementation appears to satisfy the issue: per-pod derived bases, host-bit sizing, explicit overrides, and separate MAC and NIC range pools.
Out of Scope Changes check ✅ Passed The changes stay focused on Helm values, templates, and documentation for MAC pool generation, with no obvious unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@akorobkov-nvda
akorobkov-nvda requested a review from poroh July 17, 2026 22:24

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 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 `@helm/charts/nico-machine-a-tron/README.md`:
- Around line 47-51: Restore the TOML code-fence boundaries in
helm/charts/nico-machine-a-tron/README.md: at lines 47-51, open a toml fence
before [site_explorer] and close it after override_target_port; at lines
235-236, open a toml fence before [networks.pod-0-oob] and close it after the
final gateway. Ensure subsequent Markdown sections render normally.
- Around line 367-375: Update the troubleshooting section in the README by
changing the “Check service selector” and “Check pod labels” headings to
lower-level headings that remain nested under the parent section. Wrap each
kubectl command in its own closed bash code fence, keeping the existing commands
and making the Markdown structure render correctly.

In `@helm/charts/nico-machine-a-tron/templates/configmap.yaml`:
- Line 36: Update the $hwMacBasePrefix fallback in the ConfigMap template from
the single-octet "06" value to the documented two-octet default "02:01",
matching values.yaml and producing valid hardware address prefixes when
basePrefix is absent.
- Around line 54-60: Validate the computed $podIndex after the podList lookup
and fail template rendering when it is greater than or equal to 256, before the
mac_address_pool and hw_mac_address_ranges values format it with %02x. Preserve
the existing index calculation for valid indices and use the chart’s established
template failure mechanism.
- Around line 29-35: Update the macAddressPool and hwMacAddressRanges generation
toggle assignments, including $macPoolEnabled and $hwMacRangesEnabled, so
explicit false values are preserved instead of being replaced by default true.
Use dig with an enabled key default or an explicit key-presence check, while
retaining true as the fallback when the key is absent.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 40c58f70-2d80-4a00-a75e-ab3bba7f42e5

📥 Commits

Reviewing files that changed from the base of the PR and between 0e59cee and 36866ad.

📒 Files selected for processing (5)
  • docs/development/machine-a-tron-deployment.md
  • helm-prereqs/values/machine-a-tron-multipod.yaml
  • helm/charts/nico-machine-a-tron/README.md
  • helm/charts/nico-machine-a-tron/templates/configmap.yaml
  • helm/charts/nico-machine-a-tron/values.yaml

Comment thread helm/charts/nico-machine-a-tron/README.md Outdated
Comment thread helm/charts/nico-machine-a-tron/README.md Outdated
Comment thread helm/charts/nico-machine-a-tron/templates/configmap.yaml Outdated
Comment thread helm/charts/nico-machine-a-tron/templates/configmap.yaml Outdated
Comment thread helm/charts/nico-machine-a-tron/templates/configmap.yaml
@github-actions

Copy link
Copy Markdown

@akorobkov-nvda
akorobkov-nvda force-pushed the feat/machine-a-tron-mac-assign branch from 94eb19c to ce37eff Compare July 20, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add mac address pool config to nico-machine-a-tron helm chart

2 participants