Skip to content

Conversation

@sotoiwa
Copy link

@sotoiwa sotoiwa commented Jun 23, 2025

Fix: #721

Summary

This PR updates the volumeMounts for telegraf.conf to use subPath, allowing users to mount additional configuration files (e.g., for inputs and outputs) under /etc/telegraf/telegraf.d.

Problem

Currently, the Helm chart mounts the full ConfigMap at /etc/telegraf:

    volumeMounts:
      - name: config
        mountPath: /etc/telegraf

This prevents mounting any other files under /etc/telegraf, such as custom .conf files.

Solution

By changing the mount to:

    volumeMounts:
      - name: config
        mountPath: /etc/telegraf/telegraf.conf
        subPath: telegraf.conf
        readOnly: true

we allow users to mount additional configuration files (e.g., /etc/telegraf/telegraf.d/*.conf) in parallel without conflict.

Benefits

  • Supports mounting supplemental configs via separate ConfigMaps
  • Promotes flexibility and extensibility for more complex Telegraf setups

Notes

  • readOnly: true is explicitly set for safety when using subPath

@skartikey
Copy link
Contributor

@sotoiwa
Issues/suggestions:

  1. Missing version bump - Chart.yaml still shows version 1.8.65. Per the contributing guidelines, this needs to be bumped for release
  2. Inconsistency with telegraf-ds - The telegraf-ds chart (line 65 of daemonset.yaml) still uses:
  • name: config
    mountPath: /etc/telegraf
  1. This creates behavioural divergence between similar charts
  2. Potential breaking change - Users who extended the ConfigMap via kustomize overlays or Helm post-rendering to include additional files would lose access to them. This is an edge case but worth noting in release notes
  3. Documentation gap - The chart README should be updated to document:
    - This mount behaviour change
    - How to mount additional configs in /etc/telegraf/telegraf.d/

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.

[telegraf] Cannot mount additional config files in /etc/telegraf/telegraf.d due to non-subPath volume mount

2 participants