Skip to content

fix(telegraf): use subPath for telegraf.conf to support additional config mounts #722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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

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
1 participant