Skip to content

[prometheus-node-exporter] append extraArgs to default args - #7077

Open
harsh543 wants to merge 3 commits into
prometheus-community:mainfrom
harsh543:prometheus-node-exporter/default-extra-args-6831
Open

[prometheus-node-exporter] append extraArgs to default args#7077
harsh543 wants to merge 3 commits into
prometheus-community:mainfrom
harsh543:prometheus-node-exporter/default-extra-args-6831

Conversation

@harsh543

@harsh543 harsh543 commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • move the node-exporter filesystem ignore flags into a new defaultArgs value
  • render container args with defaultArgs followed by user-provided extraArgs
  • bump the prometheus-node-exporter chart patch version

Why

Previously, users adding one custom extraArgs entry had to copy the chart defaults as well or lose the default filesystem ignore rules. Keeping defaults in defaultArgs and appending extraArgs preserves the default behavior while making custom args additive.

Fixes #6831.

Validation

  • /tmp/codex-helm/helm template pne charts/prometheus-node-exporter
  • rendered with extraArgs: [--collector.textfile.directory=/run/prometheus] and confirmed default filesystem args are still present before the custom arg
  • /tmp/codex-helm/helm lint charts/prometheus-node-exporter
  • git diff --check

harsh543 added 2 commits July 6, 2026 22:12
Add upgrade note to NOTES.txt warning users who previously set the
filesystem ignore flags via extraArgs that they must remove those entries
to avoid duplicate-flag startup errors.

Expand the values.yaml comment to explain the opt-out (defaultArgs: [])
and the migration requirement.
@harsh543
harsh543 marked this pull request as ready for review July 7, 2026 06:42
…tArgs/extraArgs ordering

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@harsh543

harsh543 commented Jul 7, 2026

Copy link
Copy Markdown
Author

Hey @jkroepke @zeritti @monotek 👋 — tagging you as the most active mergers on this repo.

What this does: Introduces defaultArgs — a new values key that prepends standard filesystem collector exclusion flags before extraArgs. The daemonset template uses concat (.Values.defaultArgs | default list) (.Values.extraArgs | default list) so both are always rendered in the correct order.

Why this matters: Right now users who want to customise extraArgs are forced to duplicate the default filesystem exclusion flags or lose them entirely. This is a footgun — omitting them causes node_exporter to attempt mounting /proc, /sys, /dev etc., which can block startup in restricted environments.

What's included:

  • values.yaml: defaultArgs with the two standard filesystem exclusion flags; extraArgs stays empty by default
  • daemonset.yaml: concat to merge both lists
  • NOTES.txt: upgrade migration warning for users who previously set these flags via extraArgs
  • unittests/daemonset_args_test.yaml: 4 helm-unittest cases covering default rendering, extraArgs appended, defaultArgs: [] opt-out, and opt-out + custom extraArgs

Upgrade safety: kingpin (used by node_exporter) uses the last value of a duplicate flag — no crash, no silent data loss. But the migration note in NOTES.txt gives users explicit guidance to clean up.

All helm lint --strict and helm template runs against the 9 CI values files pass clean. The helm unittest --strict suite runs 4/4 green.

Fixes #6831.

@monotek monotek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This changes the default and cant be a non major change.
I also don't think its worth it.

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.

[prometheus-node-exporter] extraArgs forces users to duplicate boilerplate

2 participants