feat: add helm chart for metadata-collector#281
Conversation
Signed-off-by: Ajay Mishra <[email protected]>
WalkthroughAdds a new Helm subchart "metadata-collector" to nvsentinel, including chart metadata, helpers, values, and a DaemonSet template; registers it as a dependency in the parent Chart.yaml and enables it via Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Parent as Parent Chart (nvsentinel)
participant Sub as metadata-collector (subchart)
participant Kube as Kubernetes API
Parent->>Sub: dependency declared (condition: global.metadataCollector.enabled)
Parent->>Sub: render templates with merged values
Sub->>Kube: apply DaemonSet manifest
Kube-->>Sub: schedule DaemonSet pods on nodes matching GPU + driver selectors
note right of Kube `#DFF2E1`: InitContainer runs privileged\nMain container writes to hostPath (outputPath)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
Signed-off-by: Ajay Mishra <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml (1)
102-102: Remove trailing blank line.Apply this diff to remove the extra blank line:
{{- end }} -
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
distros/kubernetes/nvsentinel/Chart.yaml(1 hunks)distros/kubernetes/nvsentinel/charts/metadata-collector/Chart.yaml(1 hunks)distros/kubernetes/nvsentinel/charts/metadata-collector/templates/_helpers.tpl(1 hunks)distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml(1 hunks)distros/kubernetes/nvsentinel/charts/metadata-collector/values.yaml(1 hunks)distros/kubernetes/nvsentinel/values.yaml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml
[warning] 102-102: too many blank lines (1 > 0)
(empty-lines)
[error] 20-20: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (8)
distros/kubernetes/nvsentinel/values.yaml (1)
46-47: LGTM!The flag follows the established pattern for component enablement and is properly namespaced under
global.distros/kubernetes/nvsentinel/Chart.yaml (1)
55-57: LGTM!The dependency declaration is consistent with the existing pattern and correctly references the new
global.metadataCollector.enabledcondition.distros/kubernetes/nvsentinel/charts/metadata-collector/Chart.yaml (1)
14-22: LGTM!Standard Helm v3 chart definition with all required fields properly configured.
distros/kubernetes/nvsentinel/charts/metadata-collector/values.yaml (1)
30-36: LGTM!Resource limits and requests are appropriately defined for a metadata collection workload.
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml (3)
42-52: Verify the necessity of elevated privileges.The DaemonSet runs with extremely high privileges:
hostNetwork: trueandhostPID: trueprivileged: true- Root user (UID/GID 0)
SYS_ADMINcapabilityWhile GPU metadata collection may require elevated access, these combined privileges grant nearly unrestricted host access and significantly expand the attack surface.
Please verify:
- Is
hostNetworkactually required for GPU metadata collection, or could the container use the pod network?- Is full
privilegedmode necessary, or would specific capabilities (e.g., just SYS_ADMIN) suffice?- Is
hostPIDaccess required for this workload?If these privileges are required, consider documenting the specific operations that necessitate them in the chart's README or comments.
53-53: LGTM!The image tag fallback logic correctly prioritizes local values, then global values, then falls back to the chart's AppVersion.
88-93: LGTM!The node selector correctly targets GPU nodes with installed NVIDIA drivers, and properly merges additional selectors from values.
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/_helpers.tpl (1)
1-40: LGTM!The helper templates follow standard Helm patterns for generating names, labels, and selectors. The implementations correctly handle truncation and include all recommended Kubernetes labels.
Signed-off-by: Ajay Mishra <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml (1)
71-71: Fix imagePullPolicy reference for pause container.Line 71 references
.Values.image.pullPolicyfor the pause container, but the pause container uses.Values.pauseImage.*configuration (see line 70). This causes the pause container's image pull policy to be controlled by the main container's image settings, which is inconsistent.Apply this diff to use the correct pull policy for the pause container:
- name: pause image: "{{ .Values.pauseImage.repository }}:{{ .Values.pauseImage.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + imagePullPolicy: IfNotPresentAlternatively, add a dedicated
pullPolicyfield under.Values.pauseImageinvalues.yamland reference it as.Values.pauseImage.pullPolicyhere.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml(1 hunks)distros/kubernetes/nvsentinel/charts/metadata-collector/values.yaml(1 hunks)distros/kubernetes/nvsentinel/values-tilt.yaml(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- distros/kubernetes/nvsentinel/charts/metadata-collector/values.yaml
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-06T10:59:26.666Z
Learnt from: XRFXLP
Repo: NVIDIA/NVSentinel PR: 281
File: distros/kubernetes/nvsentinel/charts/metadata-collector/values.yaml:20-0
Timestamp: 2025-11-06T10:59:26.666Z
Learning: The pause container image registry.k8s.io/pause:3.9+ requires eBPF and cgroup v2 support (kernel 4.15+, CONFIG_BPF, CONFIG_CGROUP_BPF, /sys/fs/bpf mounted). Older pause:3.0 images from gcr.io/google-containers/pause work on systems without full BPF/cgroup v2 support. When suggesting pause image updates, verify the target environment has necessary kernel features to avoid BPF_PROG_ATTACH errors.
Applied to files:
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml
🪛 YAMLlint (1.37.1)
distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml
[warning] 95-95: too many blank lines (1 > 0)
(empty-lines)
[error] 20-20: syntax error: expected the node content, but found '-'
(syntax)
🔇 Additional comments (3)
distros/kubernetes/nvsentinel/values-tilt.yaml (1)
67-68: LGTM!The addition of
metadataCollector.enabled: falsefollows the established pattern for feature flags and is appropriately disabled in the Tilt environment.distros/kubernetes/nvsentinel/charts/metadata-collector/templates/daemonset.yaml (2)
46-51: Clarify whether explicit SYS_ADMIN capability is needed.The initContainer is already marked as
privileged: true(line 49), which grants all Linux capabilities includingSYS_ADMIN. Adding an explicitcapabilities.add: [SYS_ADMIN]block would be redundant but may improve clarity about the container's intent.Verify with the metadata-collector team whether an explicit capability declaration is required for your security/compliance policies or if the privileged context is sufficient. If explicit declaration is preferred, add it as shown below.
If an explicit capability declaration is needed, apply this diff:
- name: metadata-collector securityContext: runAsUser: 0 runAsGroup: 0 privileged: true + capabilities: + add: + - SYS_ADMIN
54-59: Verify NVIDIA environment variables.The PR objectives mention that the initContainer should set
NVIDIA_VISIBLE_DEVICES=allandNVIDIA_DRIVER_CAPABILITIES=utility, but these are not present in the template. Confirm whether:
- These variables should be explicitly set in the container's
envsection (as shown in lines 55–59).- They are instead configured via values overrides in
.Values.envor similar.- They are intentionally omitted and handled by the NVIDIA driver runtime directly.
If they should be part of the template, add them to the
envsection.
Signed-off-by: Ajay Mishra <[email protected]>
|
This pull request has been automatically locked since it has been closed for 90 days with no further activity. Please open a new pull request for related changes. |
Summary
Type of Change
Component(s) Affected
Testing
Checklist
Summary by CodeRabbit